Suming value of child table in parent table
Suming value of child table in parent table
in Editor
Hello,
I refer to the parent child editor.
Is there a way to, instead of counting the number of users
{
data: 'users',
render: (data) => data.length
}
We make the sum of a users' field, for example their age?
I found this post but I am not sure it is pointing me in the right direction.
Thanks and regards
Answers
You should be able to make any calculations you want. Looking at the developer tools for the JSON response in the example you linked to this shows an example of one row of data in the parent:
The
columns.renderfunction is just presenting the length of theusersarray. Thecolumns.renderfunction will need changed depending on your data structure. Please provide an example of a row of data so we can help with suggestions.Kevin