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

前端 未结 10 1509
无人及你
无人及你 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:17

    Folks, no need to create divs or use CSS. It is natively available using setGridState:

    gridComplete: function ()
      {
        var recs = $('#myGrid').jqGrid('getGridParam', 'reccount');
    
        if (isNaN(recs) || recs == 0)
        {
          $("#myGrid").jqGrid('setGridState', 'hidden');
        }
        else
        {
          $("#myGrid").jqGrid('setGridState', 'visible');
        }
      }
    

提交回复
热议问题