I am using Infragistics 15.2 with JQuery 1.11.3 and JQuery UI 1.11.4.
I have an igGrid using the "Append Rows on Demand" feature. My data source is a JSON object which is returned from an AJAX call.
Here is a sample of my data source with 1 record:
[{ "TotalRowCount":"1404", "DataRecords":[{ "ID":"ced1b903-d378-e511-80f1-8a6026a92b47", "ContractNumber":"16453", "Surname":"Smith", "Status":"New Order", "Cemetery":"Land of Memory", "CustomerName":"John Smith", "Store":"ABC Monument Works", "DateCreated":"10/22/2015 10:39:01 AM" }]}]
Here is the code for my grid:
Martin,
Thank you for your help and for the explanation.
Hello Jack,
It's a valid configuration. Your original problem was that the igGrid couldn't find the number of records in the data source, thus it didn't initiate a remote request on "Load more data" click. Setting recordCountKey: "0.TotalRowCount" fixed that.
Best regards,Martin PavlovInfragistics, Inc.
FIXED:
I fixed the problem by simply changing this line in my original post:
recordCountKey: "TotalRowCount"
to
recordCountKey: "0.TotalRowCount"
The "AppendRowsOnDemand" feature now works perfectly. Is this an unusual implementation? I wasn't able to get it working any other way.
Martin Pavlov"] You should change your returned data to be wrapped in an object
You should change your returned data to be wrapped in an object
What exactly do you mean by this? I tried to return the data as a .NET DataTable rather than an array, but the grid throws one of the following exceptions:
Uncaught Error: There was an error parsing the JSON data and applying the defined data schema: The input data doesn't match the schema, the following field couldn't be mapped: ID
- OR -
Uncaught Error: The response type was either not set correctly, or it was not possible to detect it automatically. Please set settings.responseDataType and/or settings.responseContentType.
My DataTable has a column called "DataRecords" whose value is another DataTable with all the correct columns in my grid.
The reason responseDataKey: "DataRecords" is not working is because the data returned is an array. That's also the reason for the "Load more data" button not working. You should change your returned data to be wrapped in an object and set responseDataKey: "DataRecords".
Also, your column keys should not contain "DataRecords". Just use the name of the property as a column key.
Last, instead of dataSourceUrl use just dataSource.
Hope this helps,Martin PavlovInfragistics, Inc.