Hi
Can you please let me know how can we update the other row element when we update one of the element is the same row.
I have used (rowEditDone(event: any, ui: any)) event but not able to do the changes in other row element.
For example :
if i have a row with data like
Number of parts : 10
No of defective parts :
No of corrected part :
if user update the corrected part to 8 then i need to calculate the defective part (Total parts - corrected part ) then i need to set the data as defective part as 2.
Hello,
Updating the parent row of a child grid is not built into the API but can be worked around by using some DOM traversal. I suggest looking into the this forum thread with more details on how to achieve this: http://es.infragistics.com/community/forums/t/85421.aspx
To summarize, here they utilize the editCellEnded event but this can be modified to instead utilize the editRowEnded event. The API for both of these events expose a ui.owner which is a reference the the IgGridUpdating feature from which the DOM element hosting the grid can be obtained by invoking ui.owner.grid. From here DOM traversal is used to obtain an the row ID of the parent which can then be used to invoke the method to obtain the data of the row.
To obtain parent row data before editing, the code would be very similar as this will already provide the record data of the parent row. Here you would instead handle the editRowStarted event.
Let me know if you have any questions.
How can I get parent row data while editing it's child and also need to update parent depending upon the data of child edited?
The grid does not provide an API for an editable or readable view model that reflects the state of the grid.
The pendingTransactions method does provide a way to obtain all current modifications to the grid in a single object.
There is a allRows method that can be utilized to obtain the data from all the rows. The issue presented with the igHierarchicalGrid though is that it only returns data from all visible rows, therefore, if a row is collapsed this method will not return the data from those rows. It is possible to expand all rows though by utilizing the expand method of the igHierarchicalGrid as discussed in this forum post: http://es.infragistics.com/community/forums/t/88627.aspx
I suggest utilizing the pending transactions method to obtain only the rows that have been modified which will make this more performant in most scenarios.