开发者

how to set some rows un editable in jqgrid?

is there way to set some rows un editable in jqgrid after first edit is done

开发者_Python百科i tried to add class

not-editable-row

but no luck

this is how i make all rows editable

onSelectRow: function(id){
  if(id && id!==lastsel){
    grid.jqGrid('restoreRow',lastsel);
    grid.editRow(id,true);
    lastsel=id;
  }
}

any help would be great

Thanks


You don't posted the code which you use to add the 'not-editable-row' class to the row (<tr> element).

I suppose that what you need is just do this inside of aftersavefunc event handler of the editRow. So you should replace the grid.editRow(id,true) to the following:

grid.jqGrid('editRow',id,true,null,null,null,{},
            function(rowid){
                var tr = this.rows.namedItem(rowid);
                $(tr).addClass('not-editable-row');
            });

See the demo.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜