This is the datamodel for the main grid and shows I am using remote location.
dataModel: {
dataType: "JSON",
location: "remote",
recIndx: "ID",
url: "/PCA/PCAData",
getData: function (response) {
return { data: response };
}
},
I want the grid to not load data when the page loads. After I enter a parameter in an input, I want to click a button and have the parameter sent to the server and get the JSON back and load the grid with data.
I assume I need to remove the data model from the grid declaration and call the data model in the button click like below.
$('#search').click(function()
{
$( "#jsongrid" ).pqGrid("option","dataModel.getData",function( response, textStatus, jqXHR ){});
});