var column = [ { id: "custnm", name: "Customer name", type: "text" , width: "150", align: 'left' }, { id: "amt" , name: "accounts receivable" , type: "number", scale: "n", width: "150" }, { id: "amt2" , name: "accounts payable", type: "number", scale: "n", width: "150" }, { id: "amt3" , name: "sale price", type: "number", scale: "n", width: "150" }, ]; var sumColumn = [ { id: "custnm", name: "total" , type: "text" , width: "150", align: 'center' }, { id: "amt" , name: "accounts receivable" , type: "number", scale: "n" , sumtype : 'sum', width: "150" }, { id: "amt2" , name: "accounts payable", type: "number", scale: "n" , sumtype : 'avg', width: "150" }, { id: "amt3" , name: "sale price", type: "number", scale: "n" , sumtype : 'sum', width: "150" }, ]; var grid1 = new WdtGrid('grid1'); grid1.create(column, option); grid1.setSumColumn(topSumColumn); grid1.setFooterColumn(topSumColumn); grid1.setData(data);