Ag-grid node.setData (newData) doesn't execute getNodeChildDetails

When setting new data in the node line, getNodeChildDetails is not called.

We try to lazy load the tree data structure by first providing a dummy child string, and then when the string expands, we load the children via http, and then reset the parent string data, hoping the children are replaced and but getNodeChildDetails in the callable.

The pseudocode for our grid options looks like this:

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
 };

      

}

+3


source to share





All Articles