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,
This can be achieved by utilizing the editCellEnded event to then modify the corresponding cells utilizing the setCellValue method to set the values of the other columns.
Let me know if you have any questions.
I am not able to update the cell value by using setCellValue method and also i need to update its parent.
Can you please let me know how can i do that ?
As in the editCellEnded event i am not able to get parent data.
One more question i need to set HTML div tag or Angular2 Component to render before displaying as shown in pic.At the time when we edit the cell. Please have a look at it.
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://ko.infragistics.com/community/forums/t/85421.aspx
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://ko.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.
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.
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?
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.