I have a table using jqGrid, I need that when editing a row some of the columns are not available for editing according to the values on the row. I know how to avoid the editing of a row according to the cell value but at the whole row level, I don’t know how to specify at the column level. Here is the function on double click of my table.
ondblClickRow: function(id){
var code = id.split("-")[0];
var status = id.split("-")[1];
if((code == "0" && status == "255") || (code == "1" && status == "0")
|| (code == "1" && status == "1")
|| (code == "2" && status == "255")){
return;
}else{
jQuery('#nameableSignalsListView').jqGrid('editRow',id, {
keys : true,
reloadAfterSubmit:true,
successfunc: function(response, postdata) {
var result = printErrors(response, false);
if(result === true) {
return true;
} else {
setTimeout(function() {
customAlert(result);
}, 200);
return false;
}
},
restoreAfterError: false,
url: appRootUrl + "rest/nameableSignals/update"
});
}
}
I answered on the same question multiple times. The main understanding problem is that
editing: trueproperty of the column will be read byeditRowat the initialization time. So you can set the value ofeditingproperty with respect ofsetColPropmethod for example directly before calling ofeditRow. In the way you can implement any dynamic behavior which you need.See the answer, this one or this one. The last one provide solution for the usage of inline editing per
formatter: "actions".