How do I remove a CSS class from a jqGrid cell?

前端 未结 2 1130
情话喂你
情话喂你 2020-12-18 07:38

It is possible to add a CSS class to a jqGrid cell using the setCell method as below.

grid.setCell(rowId, \"ColumnName\", \"\", \"my-style-class\");
<         


        
2条回答
  •  难免孤独
    2020-12-18 08:06

    One can easily add new class to a cell by removing the old class as:

    $("#gridname").removeClass('oldclass')
                  .setCell(rowId,'column_name','','newclass');
    

    Where rowId is id of the row containing corresponding cell and can be obtained as:

    var ids = $("#gridname").jqGrid('getDataIDs');
    

提交回复
热议问题