开发者

jqgrid : setCell method > how to set class of the fourth parameter?

how to set the fourth parameter of the setCell method : the class parameter

$("#myGrid").jqGrid('setCell',rowid,'label', **class** ,{color:'black', weightfont开发者_开发技巧:'bold'});

Thank you !


You can just define in your CSS file a new class like

.MyCell {
  color:'black';
  weightfont:'bold'
}

and then use

$("#myGrid").jqGrid('setCell',rowid,'label', '', 'MyCell');

It seems to me that following will also work

$("#myGrid").jqGrid('setCell',rowid,'label', '', {color:'black', weightfont:'bold'});


Thanks a lot, it works now !

I simply wrote :

afterInsertRow: function(rowid){    
  $("#myGrid").jqGrid('setCell',rowid,'label','',{color:'gray', weightfont:'bold'});
  $("#myGrid").jqGrid('setCell',rowid,'label', '', 'ui-state-default');
},


I have used below code

$('#'+gridTable).jqGrid('setLabel', "abc", "new Label");

runs perfectly

But if i tried to change it again like

$('#'+gridTable).jqGrid('setLabel', "new Label", "new Label123");

Above code not gives an error but value of label is not changing..

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜