How can I hide the jqgrid completely when no data returned?

前端 未结 10 1531
无人及你
无人及你 2020-12-05 07:18

I\'m having a heck of a time trying to only display my jqGrid when records are returned from my webservice. I don\'t want it to be collapsed to where you only see the capti

10条回答
  •  没有蜡笔的小新
    2020-12-05 08:05

    Try this (Keep JqGrid inside a div). Also create a label to display a meesage.
                            
    
      
    And then write this after ajax call gridComplete: function () { var recs = parseInt($("#EmpTable").getGridParam("records"), 10); if (isNaN(recs) || recs == 0) { document.getElementById("lblValMessage").innerHTML = "No data found."; $("#divForImageResult").hide(); } else { $('#divForImageResult').show(); } } });

提交回复
热议问题