Skip to navigation
Background color to a jqgrid
28.09.20
gridComplete: function() { var rows = jQuery("#grid").getDataIDs(); for (var i = 0; i < rows.length; i++) { var d = jQuery("#grid").getCell(rows[i],"description"); var t = jQuery("#grid").getCell(rows[i],"Title"); var b = jQuery("#grid").getCell(rows[i],"Body"); var s = jQuery("#grid").getCell(rows[i],"section"); var y = jQuery("#grid").getCell(rows[i],"type"); var _id = jQuery("#grid").getCell(rows[i],"id"); if(t != d) { jQuery("#grid").setCell (_id,'Title','',{ 'background-color':'#8ae48a'}); } if(b != d) { jQuery("#grid").setCell (_id,'Body','',{ 'background-color':'#8ae48a'}); } if(y != s) { jQuery("#grid").setCell (_id,'type','',{ 'background-color':'#8ae48a'}); } } },
http://www.trirand.com/jqgridwiki/doku.php?id=wiki:events
Reply
Anonymous
Example: second parameter is the row ID third parameter is the column name the fourth parameter is the cell value, if you set it empty "", it will not be changed, it means the original value stays the same. The fifth parameter is for styling the cell, ``` $grid.jqGrid("setCell", "jqg25", "f", "", { "background-color": "#8ae48a" }); ```
28.09.20
Reply
Anonymous
Information Epoch 1760439268
Think parallel.
Home
Notebook
Contact us