-1

I have a tree about like here Can I use the aggregate function in nodes? To calculate the amounts of children. If so, how? Show on an example please with File Browser

Inerc
  • 13
  • 5
  • If you are using enterprise features, then you should note that there is a members forum that is actively monitored by the ag-Grid devs... https://www.ag-grid.com/forum/forumdisplay.php?fid=5 – Jarod Moser May 03 '17 at 20:19
  • Yes, I know about it, a couple of days ago I asked a question but did not get an answer. https://www.ag-grid.com/forum/showthread.php?tid=5321 – Inerc May 04 '17 at 07:42

1 Answers1

1

It can be done without aggregation:

https://embed.plnkr.co/p5NugVoXtrSXw7qyCVlx/

In the rendering of the "Name" column, I updated it with the length of the children key:

var kids = params.data.children ? params.data.children.length : 0;
return '<img src="'+imageFullUrl+'" style="padding-left: 4px;" /> ' + params.data.name + ' (' + kids + ')';

I also added a column defined as:

{headerName: "kids", field: "children.length", width: 150},

In case you like that idea better.

Jarod Moser
  • 7,022
  • 2
  • 24
  • 52
  • Cool thanks, but I asked (maybe it's not obvious), about how to calculate me the size of the folder? Maybe there is a way, and you know it? – Inerc May 04 '17 at 07:40
  • Sounds like you want to the "size" column for each bottom child and have that displayed at the folder level... kind of like the second parenthesized number in this example https://plnkr.co/edit/CZMNMknJ0XnC8sHPt2jp?p=preview – Jarod Moser May 04 '17 at 20:45