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.
I am able to update child but facing issue regarding to update its parent too.
1. How can we get the parent row data and edit the values over there also in a editRowEnding event?
2. How can we get the whole data model that is used for populating the table in an event as i am using typescript "this" will not work? Is there any better option?
3. i want to commit the whole data model in to my data base at once while using autocommit : false. How can we achieve this?
Hello,
I am attaching a sample that fulfils these requirements by modifying the provided sample.
The first modification I made was to handle the editCellEnded event rather than the editCellEnding event as this indicates that the cell value has already updated. These events are mostly interchangeable though, use whichever works best in your scenario.
It is important to note that the igHierarchicalGrid is built by multiple igGrids and to obtain an instance of child grids cannot be done by using the jQuery selector using the id of the table element used to setup the grid. The igHierarchicalGrid exposes a allChildren method for these purposes. Subce we are trying to update the values of the child band during the editCellEnded event, the API can be used to obtain an instance of the igGridUpdating feature of the igGrid that we are looking to update by using ui.owner. ui.owner can then be used to invoke the setCellValue method which then changes the logic within the editCellEnded event handler to this:
ui.owner.setCellValue(ui.rowID, "Name", "Test"); if(ui.value > 10){ ui.owner.setCellValue(ui.rowID, "Html", "<div class="line-color-danger">Test</div>"); } else{ ui.owner.setCellValue(ui.rowID, "Html", "<div class="line-color-notdone">Test</div>"); }
Let me know if you have any questions.
Please have look at the code. for updating other cell values (for example "Name" and "Html" in code attached) depending upon the edited value in price.
For Example:
if price is more than 10 then "Html" field is set danger with css "line-color-danger".
In this example i am facing two issue :
1. Not able to set values.
2. Not able to see HTML div element.
Can you please help.
Note : this issue very urgent. If we can have call it will be good for me. My number is +919922957202
It looks like the setCellValue method is being invoked prior to the grid being initialized. Is this method being called within one of the components lifecycle hooks?
Please provide more details as to at what point of the component's lifecycle the method is being called.
Please have a look at the above issue. bug related to that
I got this error while updating the cell value.
Please have look at the snap shot