jQuery UI Widgets › Forums › Grid › virtual mode with few rows
Tagged: angular grid, empty row, grid, jquery grid, jqxgrid, totalrecords, updatebounddata, virtual mode, virtualmode
This topic contains 7 replies, has 2 voices, and was last updated by Alexey 9 years ago.
-
Author
-
Hi, I have modified your example with a grid in a virtual mode.
http://jsfiddle.net/p8hn3azf/I have changed only few lines:
var source = { datatype: "array", localdata: {}, <strong>totalrecords: 5</strong> }; // load virtual data. var rendergridrows = function (params) { var data = generatedata(params.startindex,<strong> 5</strong>); return data; }
After that I got table with 5 rows with data and many empty rows. How to get rid of empty rows? I have read forum. Everyone says that populating rows excatly how in examples helped them. But how? This is not working for me.
Hi Alexey Sharifullin,
This is the normal behaviour of jqxGrid in this situation and it cannot be altered. The same question has already been answered in the following forum topics, too: Virtual scrolling mode and empty rows and Empty rows in virtualmode when totalrecords smaller than count of visible rows.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/Ok. I think it would be very helpful if you include description of that limitation to virtual mode in documentation. Such as you have to use virtual mode in use cases where returned data from server more than visible view. Otherwise blank rows will be displayed in empty visible space and there is no workaround about that.
Thanks for quick reply.
Hi Alexey Sharifullin,
Thank you for your suggestions. We will try to improve our documentation. Please note that, while empty rows appear in this case, the virtual mode functionality can be used without any issues.
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/I found a workaround for my use case. In my case I know exactly how many rows would be maximum at time of creating jqxgrid. So if maximum of rows is more than acceptable to query I am using virtual mode in another case setting virtual mode to false and populating localdata in source.
if(totalrecords <= 100){ source.localdata = rendergridrows({startindex:0, endindex:totalrecords}); }
But in my example one issue still persists. When I click toggle button to change mode from normal to virtual a virtical scrollbar is not changing respectivly. But after some scrolling it became normal (with respect of collection size). Is any way to recalculate vertical scrollbar?
Anyone is there?
Hi Alexey Sharifullin,
Please add a call updatebounddata to your solution:
$("#jqxbutton").jqxToggleButton({ width: 250, height: 30 }).on("click", function() { var toggled = $("#jqxbutton").jqxToggleButton('toggled'); if (!toggled) { changeMode(1000000); $("#jqxgrid").jqxGrid('updatebounddata'); } else { changeMode(5); } });
Best Regards,
DimitarjQWidgets team
http://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.