JQGrid, change row background color based on condition

前端 未结 9 2042
予麋鹿
予麋鹿 2020-12-24 02:22

I have the following jqgrid that uses the jquery ui theme imported to my master page.

  $(\"#shippingscheduletable\").jqGrid({
            url: $(\"#shipping         


        
9条回答
  •  一生所求
    2020-12-24 02:54

    I tried this and works to set the background color for the entire row. Works with paging also:

    gridComplete: function()
    {
        var rows = $("#"+mygrid).getDataIDs(); 
        for (var i = 0; i < rows.length; i++)
        {
            var status = $("#"+mygrid).getCell(rows[i],"status");
            if(status == "Completed")
            {
                $("#"+mygrid).jqGrid('setRowData',rows[i],false, {  color:'white',weightfont:'bold',background:'blue'});            
            }
        }
    }
    

提交回复
热议问题