var rowEdit = function (row) {
if (row == 0)
return True;
}
I have jqxGrid with 6 Columns (Unique Number,Verified "Yes or No",Tracking Number,Serial Number,Condition,Remarks)
Verified "Yes or No" is a dropdownlist.
problem: base on column "Verified" i want to enable or disable the other fields. for example if "YES" enable for editing else if "NO" disable (no edits allowed)
please assist.
Using the cellbeginedit
function in the columns
property, you can define which column is editable or not.
You have to define it on each column and inside the function, you check the value of the Verified
column to determine if the column is editable (return true
) or not (return false
).
The function takes 3 arguments
getrowdata
of the grid).columns
property.So, your rowEdit
function should look like this:
var rowEdit = function (rowindex, datafield, columntype) {
if(datafield != "Verified"){
var rowdata = $("#itemGrid").jqxGrid('getrowdata', rowindex);
return rowdata.Verified == "YES";
}
return true;
}
I've used the value YES
for the Verified
column, because I ingore which is the correct value for this data.
But, you can replace with the good one.