How to display information in jqGrid that there are not any data?

前端 未结 8 1559
不知归路
不知归路 2020-12-10 04:33

When jqGrid is empty I want to display single empty row inside the grid with information message that there are not any data. How is this possible? Thanks

8条回答
  •  旧巷少年郎
    2020-12-10 05:20

    1. Set "rows":[] for json array
    2. Append your error container on success as

      onLoadSuccess: function() {
          **var rows = $(this).datagrid("getRows");**
      if(rows.length == 0)
      {
      
        $("#errordiv").show();
        $(".datagrid-view").append('
      Ur Message
      '); } else $("#errordiv").hide(); }

提交回复
热议问题