1. #1
    Sencha User
    Join Date
    Jan 2011
    Location
    Lincoln RI
    Posts
    97
    Vote Rating
    0
    webarnie is on a distinguished road

      0  

    Default 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.

    Code:
    var quickPayStore = Ext.getCmp("quickPayGrid").store;
        	quickPayStore.each(sum, function(record) {
        		var total += record.get("amountDue");
        	});
    What is the correct syntax?

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Location
    Lincoln RI
    Posts
    97
    Vote Rating
    0
    webarnie is on a distinguished road

      0  

    Default


    i figured it out.

    Code:
    var quickPayStore = Ext.getCmp("quickPayGrid").store;
        	var amount Due = Ext.util.Format.usMoney(quickPayStore.sum("amountDue"));

Similar Threads

  1. Correct model for using filters (with Grouping)
    By Steve Lewis in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 13 Dec 2010, 1:06 PM
  2. Trim - help required for correct syntax
    By shadey_shades in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 9 Dec 2010, 6:04 AM
  3. Correct syntax and location for a valid sencha touch (js) function?
    By EduardoIbarra in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 25 Nov 2010, 5:03 PM
  4. How to handle new records in store like updated records?
    By maho2nd in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 16 Dec 2009, 2:54 AM
Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi