Reputation: 525
Is it Possible to let the jqgrid Update itself without loading the page ?
I mean live Update
For example I want the grid to show the on line Visitors on my site but I don't want to refresh the page each time to see the new users , does jqgrid support this ?
Upvotes: 0
Views: 1511
Reputation: 1
<script>
function refresh_grid(new_url)
{
jQuery("#jqgrid_table").jqGrid().setGridParam({datatype:'json'});
jQuery("#jqgrid_table").jqGrid().setGridParam({url:new_url}).trigger("reloadGrid");
jQuery("#jqgrid_table").jqGrid().trigger("reloadGrid");
}
var myVar = setInterval(function () {myTimer()}, 1000);
function myTimer() {
var url = " ...your url...";
refresh_grid(url);
}
Upvotes: 0