Sample: dhtmlxGrid Math calculations dhtmlxGrid main page
X

Calculate values with Math formulas. Edit formulas on the fly


 
<div id="gridbox" width="100%" height="250px" style="background-color:white;overflow:hidden"></div>
<script>
 
    mygrid = new dhtmlXGridObject('gridbox');
    mygrid.setImagePath("../../codebase/imgs/");
    mygrid.setHeader("Book Title,Author,Price,Quantity,Total");
    //5th column is math
    mygrid.setColTypes("ed,ed,ed,ed,ed[=c2*c3]");
    //round all calculation to 2 digits after point
    mygrid.setMathRound(2);
    //enable formula edition, disabled by default
    mygrid.enableMathEditing(true);
    mygrid.init();
    mygrid.loadXML("grid_math.xml");
    //xml contatain special math for last row to calculate grand total
</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.