In order to disable the editing of a cell, you need to define a function called ‘cellbeginedit’ in the column’s definition.
For example:
{ text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90, cellbeginedit: function (row) { if (row == 0) return false; }}
The sample code above disables the editing of a cell in the “First Name” column when the edited row’s index is equal to 0.
Let’s see how to disable the editing of an entire Grid row. In order to achieve that, we define a function with 1 parameter outside of the Grid.
var rowEdit = function (row) { if (row == 0) return false;}
Then, we set the ‘cellbeginedit’ property of all columns to point to that function. The result is that the editing of the first row is disabled.
// initialize jqxGrid$("#jqxgrid").jqxGrid({ source: dataAdapter, editable: true, selectionmode: 'singlecell', columns: [ { text: 'First Name', columntype: 'textbox', datafield: 'firstname', width: 90, cellbeginedit: rowEdit}, { text: 'Last Name', datafield: 'lastname', columntype: 'textbox', width: 90, cellbeginedit: rowEdit }, { text: 'Product', columntype: 'dropdownlist', datafield: 'productname', width: 180, cellbeginedit: rowEdit }, { text: 'Available', datafield: 'available', columntype: 'checkbox', cellbeginedit: rowEdit } ]});