1

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"
        });
    }
}
Oleg
  • 220,925
  • 34
  • 403
  • 798
Kreender
  • 284
  • 1
  • 6
  • 17

1 Answers1

0

I answered on the same question multiple times. The main understanding problem is that editing: true property of the column will be read by editRow at the initialization time. So you can set the value of editing property with respect of setColProp method for example directly before calling of editRow. 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".

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798