Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Satheesh Kumar on Jul 22, 2008 13:22
open dhtmlx forum
Retrieve the cell value of the children node

I have a grid which has the levels like that
c0 c1 c2 c3
App Manager 2 2 2 2 2
Group Name 2 2 2 2 2
Resource Type 2 2 2 2
Resource Name A 1 1 1 1
Resource Name B 1 1 1 1

when i update any cell value on Resource Name A or B, the upper levels values should be updated automitically.Please provide the sample code to acheive this. For example if i change C0 value as 0.5 for resource Name A, the resource Type value should be changed to 1.5 , also Group Name and app Manager.

Please help me on this.
Answer posted by Support on Jul 23, 2008 01:49
There are two ways

a)  It possible to define custom onEditCell event and attach code which will update parent items value when child item changed
b) You can use in-grid math
    http://dhtmlx.com/docs/products/dhtmlxTreeGrid/samples/grid_operations/treeGrid_math.html?un=1216804131000
By using =sum in column definition you enable auto sum for column ( beware that you will need to have <cell type="ed">1</cell> for elements in such column, which still may be editable )