jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Grid shows not all Data
Tagged: filter, filtering, grid, jqxgrid, server-side, sort, sorting, virtual mode, virtualmode
This topic contains 4 replies, has 2 voices, and was last updated by Michael Gross 10 years, 7 months ago.
-
AuthorGrid shows not all Data Posts
-
Hello,
i have a grid connected to a data adapter for external data. The grid in virtual mode shows all 6963 data (the data adapter is working correctly) but columnsort and columnfilter are not working. The grid with virtual mode = false shows only part of the data (821) but sorting and filtering is working. How can I get all data in the grid with sorting and filtering?
The only differences in the grid settings are
…
virtualmode: true,
rendergridrows: function (args) {
return args.data;
},
….
Regards
MichaelHello Michael,
When virtualmode is true, a different sort and filter logic has to be implemented. Please refer to the PHP demo Grid Server Sorting, Paging and Filtering to learn what approach you should take.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hello Dimitar,
thank you, but the real problem is, that the grid does not load all data out of the dataadapter if virtual mode is set to false. The same code with virtual mode = true loads all dataThe code is:
....<script type="text/javascript"> $(document).ready(function () { var source = { datatype: "json", datafields: [ { name: 'lfdnr', type: 'int' }, { name: 'sc', type: 'string' }, { name: 'dep-id', type: 'int' }, { name: 'active', type: 'string' }, { name: 'code', type: 'string' }, { name: 'costcenter', type: 'string' }, { name: 'org-chart-desc', type: 'string' } ], url: "http://85.214.117.215/portal/wa6tst.slag/getorgunitcost.p", id: 'dep-id', sortcolumn: 'dep-id', sortdirection: 'asc', data: { typ: 'JSON', code: '', name: '', sc: '' } }; var columns = [ { text: 'RecID', dataField: 'lfdnr', width: 50, editable: false }, { text: 'Country', dataField: 'code', editable: false, width: 100 }, { text: 'Cost Center', dataField: 'costcenter', width: 100, editable: false }, { text: 'Code', dataField: 'sc', editable: false, width: 100 }, { text: 'Org-Unit ID', dataField: 'dep-id', editable: false, width: 100 }, { text: 'Hierarchie Level', dataField: 'org-chart-desc', editable: false, width: 200 }, { text: 'Active', editable: false, dataField: 'active', editable: false, checkbox: true, columntype: 'checkbox', width: 50 }, ]; var dataAdapter = new $.jqx.dataAdapter(source, { }); $("#grid").jqxGrid( { theme: 'marlin', width: '800', autoheight: true, columnsresize: true, columnsreorder: true, source: dataAdapter, selectionmode: 'singlecell', sortable: true, filterable: true, filtermode: 'default', autorowheight: true, editable: false, autoshowcolumnsmenubutton: true, enablemousewheel: false, altrows: true, pageable: true, pagermode: 'default', columns: columns }); }); </script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <form name="selectform" action="grid_virtualmode.htm" method="POST"> <div id='jqxWidget' style='margin-top: 0px; margin-left: 0px; float: left;'> <div id="grid"> </div> </div> </form> </body>
Kind regards
MichaelHi Michael,
Your code seems correct. Are you sure the issue does not originate on your server-side? As you can see from the demo Large Data Set, jqxGrid supports tens of thousands of records without virtual mode enabled.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Hi Dimitar,
the server call sends all 6963 records as can be verfied by calling the url directly in the browser.I have identified the problem: the grid in virtual mode does not care about unique values in the ‘id’ column – the grid with virtualmode = false does. After setting the ‘id’ column to the unique current number, all records where loaded and displayed in the grid.
Thank you for your help,
Michael -
AuthorPosts
You must be logged in to reply to this topic.