The rowindex is changing before expanding a child grid, and after that.
Check this scenario:
http://jsfiddle.net/cv5zc8ha/1/
Click on the SECOND row in the grid, an alert appears: “row index1”
Open the first row’s hierarchial grid
Click on the SECOND row In the main grid, an alert appears: “row index 2”
Hi Salim,
Thank you for posting in Infragistics forums! What you see is actually not a bug. The rowIndex property is correct because it does not exclude the rows that serve as containers for child layouts. So when you expand the first row another TR element is rendered as a container for the child layout (it wasn’t rendered before the first expand action). Now there are 3 TR elements rendered in the grid. So the rowIndex is correct in this situation. I would recommend using ui.rowKey which represents the corresponding primary key value.
I hope this helps!
Kind regards, Petko Zhekov Software Developer
If this is not a bug, then why is the following not working with the correct row?
igGridSelection("selectRow", ui.rowIndex);
Hello,
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
Kind Regards,
Petko Zhekov
Software Developer
Infragistics, Inc.
Hi,
To check whether row is expanded or not you can use “expanded” method.
We have implemented what you suggested, but it is not logic at all. There is an inconsistancy in the behavior of your 2 functions and this is not explained at all in your documentation. Also, it needs further development to check if the child grid has been expanded or not.
Thank you for your quick response! The Selection expects the index from the data rows collection (excluding the child layouts containers). Please consider using selectRowById method like this:
igGridSelection('selectRowById', ui.rowKey)