June 27, 2013 at 9:47 am Bug with dataadapter when used in virtual mode grid #23986
I’d like to report a bug when using a dataAdapter (json data) for a grid’s source, and the grid is in virtual mode, with autoheight false.
Here’s the behaviour:
Grid page size: 500
Grid autoHeight: false
Grid height: 100% of container
Using jqxVersion: v2.9.0
Server returns 500 results.
dataAdapter.records.length: 500 (correct)
Server returns 8 results.
dataAdapter.records.length: 30 (varies, according to the height of the grid container. It’s roughly double the rows it could contain.)
Examining the dataAdapter.records shows that the first 8 contain indeed the proper data, while the rest contain the structure, but not any data -eg: firstName: “”, lastName: “” etc)
As a workaround for anyone experiencing this, I suggest using the dataAdapter.originaldata property to get the “correct” results and length.June 27, 2013 at 9:54 am Bug with dataadapter when used in virtual mode grid #23987
Take a look at the following code as an example:
var records = new Array(); records = "Data"; alert(records.length);
The result of the length is 31 and as you can see the Array is with 1 record.
The sample is with the Grid, it requests records for the view which could be from 11 to 20 and the Array will have 10 items, but the length will return 21.
http://www.jqwidgets.comJune 27, 2013 at 10:28 am Bug with dataadapter when used in virtual mode grid #23993
I mention it as a not-expected behaviour. If I want to re-use the records in other parts of my code, my first thought would be to use the dataadapters.records property, not its originaldata, nor the grids ‘getrows’ method.
As for the sample: The length is 31, because you manually declared the 31th position of the array (leaving all others empty).
If your code was instead:
var records = ;records.push("Data");alert(records.length);
the length would be properly 1.June 27, 2013 at 10:42 am Bug with dataadapter when used in virtual mode grid #23998
I am sorry that you find it to be unexpected, but that is how it should work by design. The Grid does not expect an array in virtual mode with indexes that start from 0 and you should not expect that the Array’s length will be equal to the numbers of records and I explained you why. For using the widget in Virtual Mode you may look at the available working samples.
You must be logged in to reply to this topic.