I thought I saw an article somewhere about binding a top-level column value to a child row value in a way that would allow for something analogous to:
{ headerText: "Inv Avail. Dt.", key: childRow => Max("AvailDate"), width: "140px", dataType: "date", format: "MM/dd/yyy" }
{ headerText: "Board Feet", key: childRow => Sum("BoardFeet"), width: 85px, dataType: "number", format: "###,###,###" }
Is something like this possible?
<a href="">www.wikipedia.org/">Anchor Text</a>
[test keyword](https://www.google.com)
[http://www.google.com test keyword]
[url=www.googlee.com]thanks for the info [/url]
That is exactly the information I was looking for. Thank you.
Hello Kenneth,
Thank you for posting in our forum.
You can achieve something similar using the formula property of an unbound column. This will allow you to define a function, which will calculate the value of the current cell based on values in the same record. You can find more information on the formula property and how to use it here: https://www.igniteui.com/help/api/2020.1/ui.iggrid#options:columns.formula
As the hierarchy data field is part of the parent record data you can use it to get the array of child records and aggregate and display the data you wish to show for that particular column based on those child records.
For example, if you have a hierarchy where the child records are stored in the Products parent record field and have a Price column in the child that you wish to sum and display the result in the parent, you can define a Sum column in the parent as follows:
{ headerText: "Sum", key: "Sum", unbound: true, width: "130px", dataType: "number", formula: function(recordData) { var products = recordData.Products; var sum = 0; products.forEach(function(childRec) { sum += parseFloat(childRec.Price); }); return sum; } }
I’ve attached a sample that uses this approach for your reference:
2313.hgrid.sample.zip
Let me know if this is what you are aiming to achieve.
Regards,
Maya Kirova