Hi, I have a working grid with my JSON data being read from a remote .json file. The issue I have is that the data doesnt load (display) on page load, it only loads (displays) after selecting an Rpp option from the drop down. Can anyone suggest how I would go about displaying the data on page load...does the initial Rpp option need to automatically refresh or something?
rPP: 20,
rPPOptions: [1, 10, 20, 30, 40, 50, 100, 500, 1000],
curPage: 1,
Here is my complete code:
<script type="text/javascript">
$(function () {
var colM = [
{ title: "Model", width: 300, dataIndx: "Model" },
{ title: "Repayments", width: 100, dataIndx: "Repayments" },
{ title: "Term", width: 100, dataIndx: "Term" },
{ title: "CapID", width: 100, dataIndx: "CapID" },
];
var dataModel = {
location: "remote",
sorting: "local",
paging: "local",
dataType: "JSON",
method: "GET",
sortIndx: 2,
sortDir: "up",
rPP: 20,
rPPOptions: [1, 10, 20, 30, 40, 50, 100, 500, 1000],
curPage: 1,
getUrl: function () {
return { url: "js/vehicles.json" }
},
getData: function (dataJSON) {
return { data: dataJSON };
}
}
var grid1 = $("div#grid_paging").pqGrid(
{
width: 700, height: 600,
dataModel: dataModel,
colModel: colM,
title: "Car Models",
resizable: true,
columnBorders: true,
//freezeCols: 2
});
});
</script>
<div style="margin:10px" id="grid_paging"></div>