I have treegrid. which has a add button (outside grid) through which i am adding new Rows in the treegrid. While it adds new rows nicely. and also highlights and colors rows based on condition. However, I have actioncomplete event which is responsible for some of the calculations in TreeGrid.
After adding new Rows actioncomplete event does not trigger but it triggers for the rows which are present at the time of page load (From Database)
How do i trigger actioncomplete event for newly added rows.
Below is mycode which adds rows in my grid.
Below is my code in actioncomplete event, which is responsible for setting some of the values in Cell
Thanks. Sorry there was an issue with my code. It is working as expected.
Can you please, help me with adding childs in grid at specific location. I have modified the code here https://stackblitz.com/edit/angular-g8j1el-jrahjz?file=app.component.ts Please have a look I have 2 parents P1 and Summary. Once you click on "Add" button it adds set of records at the end of grid. but i would like it to be added before summary.
How d
|
App.Component.ts
add(args) {
let maxId = Math.max.apply(
Math,
this.data.map(function (o) {
return o['ID'];
})
);
var tree = (document.getElementsByClassName('e-treegrid')[0] as any)
.ej2_instances[0];
console.log(tree);
const idx = tree.dataSource.findIndex((data) => data.ID === 20);
let templateData = this.template(maxId);
var temp: any = [
...tree.dataSource.slice(0, idx + 1),
...templateData,
...tree.dataSource.slice(idx + 1),
];
tree.dataSource = temp;
this.data = temp;
tree.refresh();
return false;
} |