开发者

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

开发者 https://www.devze.com 2022-12-30 20:09 出处:网络
how to set the fourth parameter of the setCell method : the class parameter $(\"#myGrid\").jqGrid(\'setCell\',rowid,\'label\', **class** ,{color:\'black\', weightfont开发者_开发技巧:\'bold\'});

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

精彩评论

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