Slickgrid Total
In slickgrid, I put a total aggregator sum. It sums all the rows from that column (percents) and works fine. But now I am facing that I want only get the totals from the active pe
Solution 1:
(Answered in a question edit. Converted to a community wiki answer. See What is the appropriate action when the answer to a question is added to the question itself? )
The OP wrote:
Well I solved crawling in Firebug and retesting several times. Here is my solution:
function sumTotalsFormatter(totals, columnDef) { var suma = 0; //current group...var groupo = totals.group.value; for (var i=0; i<data.length; i++) { if(data[i].active == '1') { //data[i].us is the one who makes the groups...if(groupo == 1 && data[i].us == '1') { suma += parseInt(data[i].percent); } elseif(groupo == 0 && data[i].us == '0') { suma += parseInt(data[i].percent); } } } return"Total: " + suma + "%"; }
Post a Comment for "Slickgrid Total"