Hi I am using a IgGrid. I want to do remote paging in iggrid but it doesn't work.here is my code
var data1 ={ "Records": [{"Recid":"ACCAAAAAAAABRUL","ContRecid":"CONAAAAAAAABRUM","AddrRecid":"ADDAAAAAAAABRUO","PhoneRecid":"CONAAAAAAAABRUQ","WebRecid":"CONAAAAAAAABRUU","Company":"JJ Funs Sports","Source":"Repeat Customer","AccountType":"Customer","AccountSubType":"A","RecordStatus":"","AccountRep":"","Territory":"","CustomerNo":"","VendorNo":"","Curtain":0,"Alerts":0,"Owner":"","CreateBy":"MASTER","CreateOn":"9/6/2012 9:55:21 PM","UpdateBy":"MASTER","UpdateOn":"9/6/2012 9:55:44 PM"},{"Recid":"ACCAAAAAAAABRCZ","ContRecid":"CONAAAAAAAABRDA","AddrRecid":"","PhoneRecid":"","WebRecid":"","Company":"Alta Group","Source":"","AccountType":"Corporate","AccountSubType":"Consultant","RecordStatus":"","AccountRep":"","Territory":"","CustomerNo":"","VendorNo":"","Curtain":0,"Alerts":0,"Owner":"","CreateBy":"ALLAN","CreateOn":"8/3/2012 5:35:45 PM","UpdateBy":"ALLAN","UpdateOn":"8/3/2012 5:35:00 PM"},{"Recid":"ACCAAAAAAAABRBE","ContRecid":"CONAAAAAAAAAPWK","AddrRecid":"","PhoneRecid":"CONAAAAAAAABRBF","WebRecid":"","Company":"Tripple 4 Trucking","Source":"","AccountType":"Prospect","AccountSubType":"","RecordStatus":"","AccountRep":"","Territory":"","CustomerNo":"","VendorNo":"","Curtain":0,"Alerts":0,"Owner":"","CreateBy":"ALLAN","CreateOn":"8/3/2012 3:07:44 PM","UpdateBy":"ALLAN","UpdateOn":"8/3/2012 3:08:00 PM"}], "totalCount": 500 }; $(function () { $("#grid1").igGrid({ autoGenerateColumns: false, columns: [ { headerText: "Recid", key: "Recid", dataType: "string"}, { headerText: "ContRecid", key: "ContRecid", dataType: "string"}, { headerText: "AddrRecid", key: "AddrRecid", dataType: "string" }, { headerText: "PhoneRecid", key: "PhoneRecid", dataType: "string"}, { headerText: "Company", key: "Company", dataType: "string"}, { headerText: "AccountType", key: "AccountType", dataType: "string" } ], dataSource: data1, dataSourceType: "json", type: "remoteUrl", primaryKey: "Recid", autoAdjustHeight: true, fixedHeaders : true, jQueryTemplating : true, responseDataKey: 'Records', features: [{ name: 'Paging', type: "remoteUrl", pageSize:5, visiblePageCount: 10, firstPageLabelText: "1", nextPageLabelText : "new page", totalRecCountKey : "totalCount", }] }); });
Hello,
I have a similar issue. I'm havng some problems getting server paging to work with my igGrid. Could you please post a little code example assuming the server response is a JSON object?
Thank you very much,
Hello keyur gajjar ,
Thank you for the update.
You should use recordCountKey for the purpose.
recordCountKey: 'totalRecCount'
This is the property in the response which points to the total number of records.
So if the response is a JSON object, this is the object property holding the total number of records on the backend.
http://help.infragistics.com/jQuery/2012.2/ui.iggridpaging#options
Hope this helps.
I already saw the link https://www.igniteui.com/help/iggrid-paging, but my problem is that,
whatever value I pass in "totalRecCountKey" , it doesn,t work
Hello keyur ,
Thank you for your interest in our jQuery grid.
If you want to set remote paging you should the type option to be "remote" but not "remoteUrl".
//Initialize
$(
".selector"
).igGrid({
features : [
{
name :
"Paging"
,
type :
"remote"
}
]
});
Please refer to the API documentation:
https://www.igniteui.com/help/api/2019.1/ui.iggridpaging#options
In your case you have local JSON dataSource.
By the way there is no such grid's option as type, there is dataSourceType:"remoteUrl" option but this isn't your case (you have dataSourceType:"json")
You can have remote paging, then you are binding the igGrid to remote dataSource (which is not your scenario)
https://www.igniteui.com/help/iggrid-paging
Let us know if you need further assistance.