Trying to get [=sum] to work


I have a dhtmlxtree grid defined as such:

                                week1    week2   week3   week4

{Resource Name} 13.00 6.00 15.00 11.00
{project name} 12.00 5.00 7.00 5.0
{project name} 1.00 1.00 8.00 6.0

I have week1, week2, week3, week4 defined as “edn[=sum]” in the setColTypes attribute, I have enableMathEditing(true) and have included dhtmlxgrid_math.js;

I can not get the row “Resource Name” to auto sum. The original values are created from server, then when user expands {Resource Name} the server returns the sub rows for {Resource Name}.

I think I read in one of the forums that [=sum] does not work on dynamically loaded tree grids. But in the situation where user updates Project name/week1 all rows are there for summing.

If it can’t be done with [=sum] method, is there some code that can be applied? Kind of like “on cell edit recalculate parent sum”.

Thanks in advance for your assistance.

In case of dynamic loading in your treegrid the sum of your child rows cannot be calculated before the data is loaded (before you expand the parent row). Right after the row is expanded child will be loaded and the sum will be calculated.
There is no way to calculate the sum before the row expanding.

Thank you for the reply. What you are describing is exactly what I want. Sum AFTER data load. Can`t get it to work. Will post version and sample code shortly.

Still can’t get the =sum thing to work. I am using v3.6 build 130619.

The HTML side of things:


Enterprise weekly resource forecasts
      Enteprise Resource Forecast Map


Attached is an image of what I am trying to get done.

Any help would be greatly appreciated !

math calculations work well for me in case of expanded row.

IF the issue still occurs for you, please, provide with a complete demo, where the issue can be reconstructed locally.
Here you can find a tutorial about creating a complete demo: … pport.html

Still can’t get it to work.

Zip of all files(Demo) as requested can be found here: …

Direct link to non-working demo: … index.html

Demo is setup to respond to expanding “Kim Boswell” only.

Thanks in advance for your help.

For the math calculations the cell that should have the sum need to be with empty value:

If the cell contains any value the calculation won’t be applied.

I see.

Well that would explain it.

So my method of initially calculating the sums on the back end ( because the leafs are not loaded ) will not work, as the cells need to be blank to have the sum work?

Frustrating. But if that is how it works…

Thanks for the assist.