jQuery UI Widgets › Forums › Grid › jqxGrid inside jqxTabs; grid content available only after tab is selected
This topic contains 4 replies, has 3 voices, and was last updated by admin 7 years, 7 months ago.
-
Author
-
April 20, 2017 at 3:30 am jqxGrid inside jqxTabs; grid content available only after tab is selected #93011
I recently upgraded from version 2.6 to 4.5.0
I have 4 tabs and inside each tab I have a grid. While initializing the tabs, I load the data in all of the grids as well (not keeping it on demand). I have to export all the data in the grids to JSON without opening the tabs. The problem is that while running the export command, the grid data inside the unopened tabs is not present and an error is thrown. I checked the generated HTML and the content div for the grids in unopened tabs is not loaded. This content div is loaded with data only when the corresponding tab is clicked. This should not happen as all the grids are created and loaded with data while creating the tabs only.NOTE: The same functionality was working fine with version 2.6. After changing the version and no change in code, this issue has come up.
Export command:
$("#grid-ds-PM").jqxGrid('exportdata', 'json');
April 20, 2017 at 5:11 am jqxGrid inside jqxTabs; grid content available only after tab is selected #93013Hi itsvaibhavmittal,
Grids are not created if they are not visible on the screen. This is done to speed up the loading performance in applications and many users requested about that.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comApril 20, 2017 at 6:32 am jqxGrid inside jqxTabs; grid content available only after tab is selected #93018Hi Peter,
Thanks for the response. Is there any API in jqxgrid that could tell me whether the grid content has been loaded or not ?
April 20, 2017 at 6:53 pm jqxGrid inside jqxTabs; grid content available only after tab is selected #93043Peter,
I googled for this and found some answers. I tried
$("#grid-cs-HR").jqxGrid('getrows')
and it returns me the rows that are supposed to be there. But when I run$("#grid-cs-HR").jqxGrid('exportdata', 'json')
, it shows an error because this grid was never visible and it’s data was never loaded.April 20, 2017 at 7:53 pm jqxGrid inside jqxTabs; grid content available only after tab is selected #93044Hi Vaibhav Mittal,
The Grid raises a ‘ready’ callback when the Grid is ready for usage. As far as I know it also has “rendered” callback. You should ensure that any of these is called before trying to use any Grid API. You cannot use API of something which is not ready for usage.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.