PDA

View Full Version : how to get all the values of column in the grid.



kamalakarreddy vancha
22 Oct 2013, 7:20 AM
Hi...
here i created one grid with 3 columns(one, two, three).
i need the all the values of column one in the grid what are existing in the grid..

thanks

scottmartin
24 Oct 2013, 5:57 AM
Do you need count / sum?



columns: [{
dataIndex: 'student',
text: 'Name',
summaryType: 'count',
summaryRenderer: function(value, summaryData, dataIndex) {
sumObject = summaryData;
return Ext.String.format('{0} row{1}', value, value !== 1 ? 's' : '');
}
}


Or you can simply loop the store and get the values


var total = 0;
store.each(function(rec) {
total += rec.get('field');
});


Scott