I am using the igHierarchicalGrid to display rows that can contain children that can contain children that can contain children, down to an unknown depth. I programatically create my child grid layouts on the server based on data in a table and all levels are the same type of record. When my grid is rendered, I could have rows that only go down to a depth of 2, or it could be 8, it is not static.
What I want is an 'Expand All' function that expands all children rows recursively through the grid. Is there an easy way to do this? I cannot seem to find a simple answer for this problem.
Hello Mike,
Sorry for the late response.
We don't have public API which can do this job for you. The igHierarchicalGrid.expand API method can be used for this purpose.
Here is my own implementation of such function:
It's interesting to note that this code expands one level at a time and should wait for the child grids to expand. Given the fact that public methods do not rise events I used the setInterval API to wait 1 second before I try to expand the next level from the hierarchy. Of course this approach may fail on slower browsers where 1 second will be not enough for the child grids to expand, so you may need to change this parameter.
Here is how you use the function:
expandAllRows($("#grid1"));
where $("#grid1") is the placeholder for the igHierarchicalGrid.
P.S.: You can submit a new product idea about this functionality here.
Hope this helps,
Martin PavlovInfragistics, Inc.
We have a similar setup and are attempting to use this code for Expand/ Collapse All Buttons. It is working for all levels but is extremely slow. For some of our grids it is taking over 30 minutes. Why would it be taking this long? Is there a way to speed it up?
Hello Martin,
Thanks for your post, i am following this for one of my need in project. I would like to inform you i am using Infragistics 13.2.20132.1010 version. i am getting an error. Also i am unable do use of inherit functionality of igHierarchicalGrid,is it because of current version or what. Please find an code and error image and advise me further.
Many Thanks in advance.