- Home
- Forum
- Angular - EJ 2
- Updating the dataSource of the tree grid does not update it visually
Updating the dataSource of the tree grid does not update it visually
Hi Syncfusion,
TreeGrid is an amazing component and we would like to utilize it in our app however there are a few functionalities that are either not supported or obscure from the documentation.
This was the documentation that I followed for this example. How to Cascading DropDownList with Tree Grid editing in Angular TreeGrid component - Syncfusion
I've also attached a sample Angular application.
Here are my use cases:
- I need to update the fields of all the child rows within a parent row when the user makes a change in the parent row. It works at the moment but only visually. I've also tried programmatically updating the dataSource but it does not reflect on the Treegrid component. So my question is, how do I change the parent row field and programmatically update its children and have it reflect on both the datasource and the treegrid component?
- I've added an iconclass on the dropdownlist but the icons doesn't show up. How do I add icons to the dropdownlist in the treegrid?
Thank you so much and hoping for a swift reply
Here is the attachment
Attachment: treegridquestion_3987dc16.7z
Any update on this?
Hi,
Thanks for the response. Any update on this?
|
App.Component.ts
setChildren(userId: string, parentEntity: any, newPermission: string): void {
const rowIndex = parentEntity.index;
const childRecords = parentEntity.childRecords;
childRecords.forEach((childRecord: { index: number }) => {
this.gridObj.setCellValue(childRecord.ID, userId, newPermission);
});
this.gridObj.setCellValue(parentEntity.ID, userId, newPermission); // updates the
} |
Hello,
This doesn't seem to work as expected. The user column exists multiple times in the Grid. Although they are in different stacked headers, they are still the same column. Updating one cell should also update the other one.
|
App.Component.ts:-
setChildren(userId: string, parentEntity: any, newPermission: string) : void {
// this works visually but does not update the dataSource
const rowIndex = parentEntity.index;
const childRecords = parentEntity.childRecords;
childRecords.forEach((childRecord: { index: number
}) => {
this.gridObj.setCellValue(childRecord.ID, userId, newPermission); //update the child values into the dataSource
});
this.gridObj.setCellValue(parentEntity.ID, userId, newPermission); //update parent value
this.gridObj.refresh(); //refresh the TreeGrid
}
|
- 7 Replies
- 3 Participants
-
VO Vince Orio
- Jul 20, 2021 06:52 AM UTC
- Jul 26, 2021 03:14 PM UTC