0

I was following this link to hide JQGRID when No Data Returned How can I hide the jqgrid completely when no data returned?

Am using the below code in .cshtml

<div id="gridWrapper">
    <table id="list1">
    </table>
    <div id="pager">
    </div>
</div>

<div id="noSearchResults">
    No records Found!
</div>

and in GridComplete

gridComplete: function () {
    var recs = parseInt($("#list1").getGridParam("records"), 10);
    if (isNaN(recs) || recs == 0) {
        $("#gridWrapper").hide();
        $("#noSearchResults").Show();
    }
    else {
        $('#gridWrapper').show();
        $("#noSearchResults").Hide();
    }
} 

But when $("#noSearchResults") is executed result is not as expected am getting Error catch in Jqgrid file. What i am doing wrong ?

Community
  • 1
  • 1
user2067567
  • 3,695
  • 15
  • 49
  • 77

1 Answers1

1

There is no error in your code except Hide should be hide and Show should be show change this, if you getting error then provide your grid definition.

Meraj
  • 426
  • 3
  • 10
  • 22