Hi experts, please take a look at following link, http://www.igniteui.com/hierarchical-grid/overview . What's the best way to get the Beverages row, and then get "Fruit punch" row, and then get the quality of this row, which is 4. I know I can definitely do this by iterating the table dom tree, but is there a specific iggrid api for doing this?
If I try from outer grid to inner grid, I can get all rows of hierarchical grid by using http://help.infragistics.com/jQuery/2015.1/ui.iggrid_hg#methods:rows, but how can I get the inner grid widget of row[1]?
If I try from inner grid to outer grid, I can get all children widgets by using http://help.infragistics.com/jQuery/2015.1/ui.ighierarchicalgrid#methods:allChildrenWidgets, but how can I know which row this inner widget belongs to?
Hello Ming,
You can access the "Beverages" row data and its child row data using the following code:
$("#hierarchicalGrid").data("igHierarchicalGrid").options.dataSource[1].Products[1].Name - this will return "Fruit punch"
$("#hierarchicalGrid").data("igHierarchicalGrid").options.dataSource[1].Products[1].Quantity - this will return "4"
If you have any further questions, feel free to contact me.
Regards,
Tsanna
Hi Tsanna, thank you very much for your reply. Yes, I can always get the value via its underlying datasource. But the premise is that I always know the index of that row. Imagine I have a huge datasource, and I need to find out which product's quality equals 4, the only way comes to my mind is to loop through this huge datasource? Is there a more efficient way to do this? Can I get the row value at the time when each row get bounded/rendered, so I can save the time of loop through this huge datasrouce? Thanks in advance.