-
15 Mar 2011 7:53 AM #1
what is the correct syntax to loop through the records for a grouping Store?
what is the correct syntax to loop through the records for a grouping Store?
I have a grouping store that I am using to get totals. I also have to take the total of one of the columns and populate another field on the screen. I do not see any way of obtaining that value directly, therefore I was going to iterate over the collection of records and calculate it. Is this the best approach? Can you obtain the total directly or does it need to be re-calculated?
Looking at the documentation for a store, there is an each function. I am trying to use this but do not understand the documentation. Here is what I have coded but the syntax is wrong.
What is the correct syntax?Code:var quickPayStore = Ext.getCmp("quickPayGrid").store; quickPayStore.each(sum, function(record) { var total += record.get("amountDue"); });
-
15 Mar 2011 9:39 AM #2
i figured it out.
Code:var quickPayStore = Ext.getCmp("quickPayGrid").store; var amount Due = Ext.util.Format.usMoney(quickPayStore.sum("amountDue"));
Similar Threads
-
Correct model for using filters (with Grouping)
By Steve Lewis in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 13 Dec 2010, 1:06 PM -
Trim - help required for correct syntax
By shadey_shades in forum Ext 2.x: Help & DiscussionReplies: 2Last Post: 9 Dec 2010, 6:04 AM -
Correct syntax and location for a valid sencha touch (js) function?
By EduardoIbarra in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 25 Nov 2010, 5:03 PM -
How to handle new records in store like updated records?
By maho2nd in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 16 Dec 2009, 2:54 AM


Reply With Quote