1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    93
    Vote Rating
    0
    vijayakumar84 is on a distinguished road

      0  

    Default Unanswered: How to group the value from json response in extjs

    Unanswered: How to group the value from json response in extjs


    How to summation the value curValue,PreVal using curMon with same name in below response e.g curMon jan=23.4567+2045671+2045671 from below response
    Code:
    {
       "responseXML":{
          "months":9,
          "rows":{
             "rowCount":93,
             "row":[
                {
                   curMon:"Jan"
                   curVal:23.4567,
                   preVal: 33.5677
    
    
                },
                {
                 curMon:"Feb"
                   curVal:423.78482878,
                   preVal: 460.57905554 
                },
                {
                  curMon:"Jan"
                   curVal:2045671,
                   preVal:305678
       
                },
                {
                 curMon:"Feb"
                   curVal:26789.20,
                   preVal: 24567.20   
                },
                {
                  curMon:"Jan"
                   curVal:2045671,
                   preVal:305678
         
                },
                {
                 
                 curMon:"Feb"
                   curVal:26789.20,
                   preVal: 24567.20   
                },
                {
                 
                 curMon:"Mar"
                   curVal:26789.20,
                   preVal: 24567.20   
                },
                {
                 curMon:"Feb"
                   curVal:26789.20,
                   preVal: 24567.20   
                },
                {
                 curMon:"Jan"
                   curVal:2045671,
                   preVal:305678
            
                },
                {
                 curMon:"Mar"
                   curVal:26789.20,
                   preVal: 24567.20   
                },  
                },
                {
                 curMon:"Feb"
                   curVal:26789.20,
                   preVal: 24567.20     
                },
                {
                  curMon:"Jan"
                   curVal:2045671,
                   preVal:305678 
                },
                {
                 curMon:"Mar"
                   curVal:26789.20,
                   preVal: 24567.20  
                },
               
               
                
                
               
               
                
               
             ]
          }
       }
    }
    Last edited by vijayakumar84; 20 Apr 2013 at 8:51 AM. Reason: Summation the value

  2. #2
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,468
    Answers
    441
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    If the data is loaded to a store used by a grid you might be able to put the GroupingSummary feature to use:
    http://docs.sencha.com/extjs/4.2.0/#...roupingSummary

    Or are you just needing to sum the raw data from the JSON without it being in a store/component?

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Posts
    93
    Vote Rating
    0
    vijayakumar84 is on a distinguished road

      0  

    Default


    Hi slemmon,
    Thanks for reply .My whole response will available in store.I want to summate the curVal and preVal for month
    jan=23.4567+2045671+2045671.I want to store in array variable like eg can u tell how to do can u provide example.is it possible to summate the value at the time of parsing?
    a[0]=jan curVal total value
    a[1]=feb curTotal value

    b[0]=jan preVal total value
    b[1]=feb preVal total value


  4. #4
    Sencha - Support Team slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    5,468
    Answers
    441
    Vote Rating
    202
    slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of slemmon has much to be proud of

      0  

    Default


    Did you look at the summaryType and summaryRenderer information at the top of the API Doc?
    http://docs.sencha.com/extjs/4.2.0/#...roupingSummary

  5. #5
    Sencha User
    Join Date
    Nov 2012
    Posts
    10
    Answers
    1
    Vote Rating
    0
    kerum is on a distinguished road

      0  

    Default summaryType and summaryRender in API doc

    summaryType and summaryRender in API doc


    in which class are the options summaryType and summaryRender defined?
    I've looked in the API of Column but didn't find them there.
    Is there any other reference in API on that options beside description of GroupingSummary?