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
The example you have shared with the functionality is a default one. As you can see in my above post. I need set focus to next child of other parent if it is the last child first of hierarchical grid. As i have mentioned above post pic.
For example : In the below pic you can see the editing row is right now is "Vint soda". Now when i press enter key focus will move to "DVD Player Price". That is what my requirement is. if the below parent is collapsed it should expand and focus move to first child and above parent must be collapsed.
Note : This issue is urgent. It will be good if we can have a call. My number is +919922957202
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.
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.
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) }}
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");
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.