Hello Paul,
The short answer.
When you click first time the button, the grid is created and the data is populated – this is ok, but when you click second time to the button the grid is already created and you can not create it again using your approach
There are some way to overcome this.
1. Before creating a grid you can apply GridUnload method to restore the element to its default state.
2. There are more elegant way
$(“#mygrid”).jqGrid({datatype:”local”….}).setGridParam({datatype:”xml”});
and when you click your button
$(“#mybutton”).click(function() {
thisURL= …..
$(“#mygrid”).setGridParam({url:thisURL}).trigger(“reloadGrid”);
});
Hope this helps
Regards
Tony