8
« on: July 21, 2018, 05:39:55 am »
Hi,
I am trying to get a first try at using location: "remote" and having no success.
I see in Fiddler that the call to the supplied URL for the data is made and a valid
JSON string is returned, but PQGrid always says, "No Rows to display".
I must be doing something dumb, but I just don't see it. Code is below.
Many thanks for any help.
Cheers,
Geoff
Returned JSon:
[{"fltrID":68247,"prj_code":"148806","days_actual":263,"days_actual_formatted":"263","days_review_threshold":8.77,"days_inactivity_threshold":2.92,"cost_actual":68.30,"cost_review_threshold":0.034150,"alertStatus":2}]
HTML/Javascript:
<div id="grid_array"></div>
<script>
$(function () {
//Initialize
var oSummaryData = {
recIndx: "fltrID", //primary key
location: "remote",
sorting: "local",
dataType: "JSON",
method: "GET",
url: "/PQGridPOC/PQGridPOC/Home/PQGridDataSource",
getData: function (response) {
return { data: response.data };
}
};
var obj = {};
obj.width = 700;
obj.height = 400;
obj.colModel = [
{ title: "fltrID", dataIndx: 0 },
{ title: "prj", dataIndx: 1 },
{ title: "code", dataIndx: 2 },
{ title: "days", dataIndx: 3 },
{ title: "actual", dataIndx: 4 },
{ title: "days_actual_formatted", dataIndx: 5 },
{ title: "days_review_threshold", dataIndx: 6 },
{ title: "days_inactivity_threshold", dataIndx: 7 },
{ title: "cost_actual", dataIndx: 8 },
{ title: "cost_review_threshold", dataIndx: 9 },
{ title: "alertStatus", dataIndx: 10 },
];
obj.dataModel = oSummaryData;
$("#grid_array").pqGrid(obj);
});
</script>