Sample: dhtmlxTreeGridMath calculationsdhtmlxTreeGrid main page
X

Calculate sum of children values automaticaly with [=sum]


 
<div id="gridbox" width="100%" height="250px" style="background-color:white;overflow:hidden"></div>
<script>
 
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("../../../dhtmlxGrid/codebase/imgs/");
    mygrid.setHeader("Book Title,Author,Price,Quantity,Total");
    //5th column is math with output of price type
    mygrid.setColTypes("tree,price,ed[=sum],price[=sum]");
    //round all calculation to 2 digits after point
    mygrid.setMathRound(2);
    mygrid.init();
    mygrid.loadXML("grid_math2.xml");
</script>
THIS PAGE CONTAINS SAMPLE FUNCTIONALITY OF PROFESSIONAL EDITION FOR DEMONSTRATION PURPOSE ONLY.
UNAUTHORIZED USE IS PROHIBITED. PLEASE CONTACT SALES@DHTMLX.COM TO OBTAIN A LEGAL COPY OF PROFESSIONAL EDITION.