ag-grid node.setData(newData) does not execute getNodeChildDetails

Viewed 994

When setting new data on a row node, the getNodeChildDetails is not being called.

We are trying to lazy load a tree data structure by first providing a dummy child row and later, when the row is expanded, we load the children via http and then reset the parent row data, hoping the children replaced and loaded, but getNodeChildDetails in not called.

Pseudocode of our grid options is as follows:

onRowGroupOpened: function (event) {
  var node = event.node
  var api = this.api
  if (node.allLeafChildren[0].data.__loadingFacade) {
    loadChildrenFn(node.data).then(function (children) {
      var newData = angular.extend(
        {}, node.data, { __children: children }
      );
      node.setData(newData);
    });
  }
},

getNodeChildDetails: function (rowItem) {
  if (rowItem.__loadingFacade) {
    return null
  }
  return {
    group: true,
    children: rowItem.__children || [{ __loadingFacade: 1 }],
    key: rowItem.row_id
 };

}

0 Answers
Related