I am facing the issue regarding the updating of data in child table. After an update of child element the focus need to be shifted to next row but doesn't happen. But when i did not change any value in edited column and press enter focus is shifted to next row without any problem.
Hello,
The expected behavior of the igGrid (the igHierarchicalGrid creates multiple instances of igGrid) is after pressing the enter key after updating a value in the cell is to go to the next row. Does the issue reproduce in this sample: http://jsfiddle.net/orgq4vmp/
Please provide the following:
Properties that are being set when initializing the grid.
Browser that reproduces this behavior.
Let me know if you have any questions.
Please have a look at my code i am facing this issue. and I am using Ighierchialgrid
I am able move the focus to next child but i need to do autoCommit: false
But i dont want to use autoCommit as false. Is their any other way to do that?
One more question as you can see in attached pic i need to set focus to next editing column for other parent child.
For eg : As you see in pic acqvalue is have focus right now but when i press enter focus will go to NIO field to other parent children.
Thanks
Ankur
That approach won't work as it is referencing the parent grid. This can be achieved by using DOM traversal by using the callback parameter of the expand event and accessing the nested igGrid:
This is the resulting code:
var rowIndex = nextParentRow.attr("data-row-idx");
$("#hierarchicalGrid").igHierarchicalGrid("expand", nextParentRow, (grid) => { var rowID = $($(grid.allChildren()[rowIndex - 1]).data().igGrid.rowAt(0)).children().first().text(); $(grid.allChildren()[rowIndex - 1]).data().igGridUpdating.startEdit(Number(rowID), "Name")});
Note that the logic to obtain the rowID in your case will be different.
I am attaching a sample I used to test this behavior.
Thanks it works fine but i need to set child row in to an edit mode. How can we set that?
i have used like this but does not work.
$("#hgrid1").igGridUpdating("startEdit", ui.rowID, "NIO");
I am attaching a sample that achieves of a igHierarchicalGrid that expands the next parent row when the user edits the last row within the child band.
Within the editRowEnded event, DOM traversal can be utilized to check if there is another parent grid within a child band and if it is the last row within that child band. This is the resulting code used within the event:
editRowEnded: function(evt, ui){ var currentRow = ui.owner.grid.rowById(ui.rowID); if(!currentRow.next().length && ui.owner.grid.element.closest("tr").next().length) { var nextParentRow = ui.owner.grid.element.closest("tr").next(); $("#hierarchicalGrid").igHierarchicalGrid("expand", nextParentRow) }}
1. Can you please let me know how can i know if row is last child of the parent ?
2. How we get to know about the next parent so that we can expand then we need find the first child then only we can set the row in edit mode?
If you can give me a working example it will be very helpful for us.
This functionality is not supported by the grid out of the box and would require custom implementation.
It is possible to handle the editRowEnding event and determine if the cell is the last cell of that child band, to then set edit mode on the cell of the next band using the startEdit method.