jQWidgets Forums
jQuery UI Widgets › Forums › TreeGrid › expansion after sorting is done
Tagged: Expansion, sorting, virtualModeCreateRecords
This topic contains 6 replies, has 2 voices, and was last updated by vankin09 9 years, 8 months ago.
-
Author
-
Hi,
I found a potential bug. Please check if this needs to be fixed.
The bug can be seen in the following fiddle : http://jsfiddle.net/vankin09/31sqm9b7/Here I am adding two root objects so that I will be able to sort later when required.
Both the root objects have empty children array to get the expansion button.
Now when I expand any of the root objects in the unsorted manner, I don’t see any issue.
However, the issue is visible when I sort the grid. In that case an empty row appears below the expanded node.I debugged and found this piece of code in jqxtreegrid.js
=====EULA Violation=====
In unsorted grid, record is false, so it returns, but in case of sorted grid record is returned as true as some kind of conversion happens while sorting and record now has an inner attribute called originalRecord which actually has the empty child.
Also when I expand once, then do a collapse and expand again virtualModeCreateRecords is not called.
Whereas when I sort and then expand, I observe that the virtualModeCreateRecords is called.
So I am a bit confused about the behaviour of virtualModeCreateRecords.
If possible, can you explain how it works?Regards,
VaNKiNHi VaNKiN,
If we consider this to be a problem, we will add a work item for a future release. For now, we don’t support empty children in the TreeGrid. The virtualModeCreateRecords is demonstrated how it works in the TreeGrid’s examples available online. You may learn how it works from the samples.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
If empty children are not supported in the treeGrid, I won’t be able to get the expand icon for the root node and therefore I won’t be able to expand that node(when the hierachy demands children to be available).
For the virtualModeCreateRecords, I found some examples but none of them had support for both sorting and virtualModeCreateRecords.
I am interested in the reason for such different behaviors.
If are any such examples available can you send me the link?Regards,
VaNKiNHi VaNKiN,
load on demand is possible only through virtualModeCreateRecords which is demonstrated in the samples. All the samples which we have are available on our website. We do not have other examples.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
I understand what you are trying to convey here but shouldn’t load on demand happen only the first time the row is expanded.
I will tell you my concern .
The flow is :
I have fetched data, now I expand a row, It makes a call to virtualModeCreateRecords. I collapse and expand again. This time virtualModeCreateRecords is not called.
Now I do sorting and then I try expansion on the same row. This time I can see that a call is made to virtualModeCreateRecords.
This happened as I observed that a property was missing after I performed sorting. The property was loadedOnDemand.
The first time I had expanded I could see that the property had been populated and it was available in the data until I performed sorting.There’s an example where data is fetched from the server. Currently there’s one root row Andrew. Is it possible to add one more root row to the same server. and the sorting functionality can be added there too.
I would appreciate if an example can be added or if the same example can be edited.
Regards,
VaNKiNHi VaNKiN,
For now we do not plan adding or changing TreeGrid samples. If you would like you can edit existing samples which come with the download package.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Thank you for the assistance. I will try to simulate the behavior and send the link to you.
Regards,
VaNKiN -
AuthorPosts
You must be logged in to reply to this topic.