jQuery UI Widgets › Forums › Grid › Beginner: Grid, Dataadapter and Paging
Tagged: grid paging dataadapter
This topic contains 4 replies, has 2 voices, and was last updated by Peter Stoev 11 years, 7 months ago.
-
Author
-
Hi there,
i have a newbie question, but i’m scratching my head on this one. I have a grid, bound to a dataadapter. On the grid, paging and filtering is explicit disabled, but the GET-call from the dataadapter allways includes following parameters in the GET-url:
?filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=18&_=1386768031615
I want to get all data, then cache it clientside for paging and filtering, but in the first step i just want to get my data bound to the grid.
Here’s my code:
var source = { type: "GET", datatype: "json", datafields: [ { name: 'url' }, { name: 'category', type: 'int' }, { name: 'info' }, { name: 'status', type: 'bool' } ], url: '/api/redirects/Getallredirects', id: 'id' }; var dataAdapter = new $.jqx.dataAdapter(source, { contentType: 'application/json; charset=utf-8', loadError: function (xhr, status, error) { alert(error); }, downloadComplete: function (data) { var returnData = {}; returnData.records = data.d; return returnData; } }); $("#jqxgrid").jqxGrid({ source: dataAdapter, filterable: false, pageable: false, virtualmode: false, columns: [ { text: 'URL', dataField: 'url', width: 100 }, { text: 'Category', dataField: 'category', width: 100 }, { text: 'Info', dataField: 'info', width: 180 }, { text: 'Status', dataField: 'status', width: 80, cellsalign: 'right' }, ] });
Hi fbrem,
If you get all the data, why do you need to enable virtualmode at all? It’s appropriate for scenarios with many thousands/millions of data records, but I don’t think that it is reasonable to download all that data on the client at once.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
i don’t understand your question. I don’t get any data, the GET-call fails because of the included parameters
?filterscount=0&groupscount=0&pagenum=0&pagesize=10&recordstartindex=0&recordendindex=18&_=1386768031615
.How do i get rid of them?
I got an answer to this question on stackoverflow (http://stackoverflow.com/questions/20537014/jqwidgets-jqxgrid-dataadapter-and-paging) In the dataadapter include:
formatData: function (data) { return {}; },
and in the source:
cache: true
Hi fbrem,
Thanks for the update!
The answer there is from us, too
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.