简体   繁体   中英

Ag-grid update data fails when master/detail is active and at least one row expanded to it's details

I'm using Ag-grid angular enterprise edition in my project. I set the grid data by clicking on a submit form button using grid's API as follow:

api.setRowData(newData);

the update data will be done without any problem if masterDetail is inactive. in gridOption

masterDetail: false,

If i try to use masterDetail option, update form works until one row expanded to it's details. after that submit button won't change the grid data rows in the screen anymore. however when i get the grid data by grid's API like this:

let rowData = [];
api.forEachNode(node => rowData.push(node.data));
console.log(rowData)

the rowData is the correct data in the console, but in action I can't see the correct data in the grid.

I hopefully found the problem. my mistake was that the Id I set for rowNode wasn't unique. after fixing that the problem solved.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM