jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › "TypeError: this.rowinfo is undefined" after ready callback
Tagged: treegrid component, treeGrid ready Promise
This topic contains 3 replies, has 2 voices, and was last updated by admin 4 years, 2 months ago.
-
Author
-
I’m initializing several treeGrids each within a Promise. The ready callback for each treeGrid calls the Promise’s resolve method. I have a Promise.all with an iterator for all the Promises. When all the Promise resolutions are complete, a then attempts to expandRow and selectRow for one of the treeGrids. But I get the following error…
TypeError: this.rowinfo is undefined _doSelection http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxdatatable.js:8 selectrowbykey http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxdatatable.js:8 selectRow http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxtreegrid.js:8 invoke http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxcore.js:15 jqxWidgetProxy http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxcore.js:15 b.jqx.jqxWidget/b.fn[h]/< http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxcore.js:15 jQuery 2 each each h http://localhost:8080/pooka/lib/jqwidgets-ver9.0.0/jqxcore.js:15 initialize http://localhost:8080/pooka/common/hapi.js:21 <anonymous> http://localhost:8080/pooka/scl/scl.html#:124
If I add a 3 second delay prior to the expandRow/selectRow, it completes successfully.
Is ready the correct callback point to expect the treeGrid to be completely finished or are there addition asynchronous steps to be complete?
Hi,
If you use the document.ready or window.onload for initializing the TreeGrid, it will work. At that point all required Javascript and CSS files will be loaded.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/Peter,
I have used $(document).ready to both set up my treeGrid and subsequently call expandAll and selectRow.
I have found that if I set async to false in my treeGrid’s dataAdapter and remove the 3 second delay before expanding and selecting, this too will cause it to work properly. But it seems to be either/or. I can not rely on the ready callback if it is asynchronous, causing me to need the delay mechanism. Choosing synchronous, well then it works.
It just seems the ready callback is not actually ready if the dataAdapter is an asynchronous AJAX call.
Thanks
Hi dacracot,
Could you provide your initialization code? In jqxGrid and jqxTreeGrid we have “ready” properties i.e when the component is rendered and data is loaded, the callback is called and is the best place to call expandAll, etc.
Best regards,
Peter StoevjQWidgets Team
https://www.jqwidgets.com/ -
AuthorPosts
You must be logged in to reply to this topic.