javascript - Totalling an ExtJS editable grid's input fields -


this question regards extjs 3 editable grids. have need total input fields of 1 column of editable grid. there the store's sum method data in input fields not in store; instance might make entry in input field , click button on toolbar.

the "traditional" way in case seems to set appropriate listener , commit content of input field store, can convoluted , seems downright unnecessary if result of clicking toolbar button re-directed elsewhere anyway. there solution?

an alternative gather input fields using oft-overlooked ext.query functionality; following second column of grid ('.x-grid-col-0' first column):

var qtyfields = ext.query('.x-grid3-col-1 input', mygrid.getview().mainbody.dom); var total = 0; var qty;  (var i=0, n=qtyfields.length; i<n; i++) {     qty = parsefloat(qtyfields[i].value);     total += isnan(qty) ? 0 : qty; } 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -