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 ?