Sample: dhtmlxTreeGridAggregation in TreeGriddhtmlxTreeGrid main page
X

TreeGrid allows to calculate a sum, an average, a minimum and a maximum of each column.

 
<div id="gridbox" width="100%" height="250px" style="background-color:white;overflow:hidden"></div>
<script>
 
    /*total filtering*/
    mygrid = new dhtmlXGridObject('gridbox');
        ...
    mygrid.attachFooter('Total:,${#stat_tree_total},{#stat_tree_total}');
    mygrid.attachFooter('Multi total:,${#stat_tree_multi_total}1:2,{#stat_tree_multi_total}1:2');
    mygrid.attachFooter('Maximum:,${#stat_tree_max},{#stat_tree_max}');
    mygrid.attachFooter('Minimum:,${#stat_tree_min},{#stat_tree_min}');
    mygrid.attachFooter('Average:,${#stat_tree_average},{#stat_tree_average}');
    mygrid.attachFooter('Count:,{#stat_tree_count},#cspan');
    
    /*leaves filtering*/
    mygrid1 = new dhtmlXGridObject('gridbox1');
    ...
    mygrid1.attachFooter('Total leaves:,${#stat_tree_total_leaf},{#stat_tree_total_leaf}');
    mygrid1.attachFooter('Multi total leaves:,${#stat_tree_multi_total_leaf}1:2,{#stat_tree_multi_total_leaf}1:2');
    mygrid1.attachFooter('Maximum leaves:,${#stat_tree_max_leaf},{#stat_tree_max_leaf}');
    mygrid1.attachFooter('Minimum leaves:,${#stat_tree_min_leaf},{#stat_tree_min_leaf}');
    mygrid1.attachFooter('Average leaves:,${#stat_tree_average_leaf},{#stat_tree_average_leaf}');
    mygrid1.attachFooter('Count leaves:,{#stat_tree_count_leaf},#cspan');
</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.