Take the 2-minute tour ×

In my rest service I return a json model containing a single balance value and an enumerable list of statement transactions. I need to be able return the balance figure to my view, whilst setting the enumerable items to the dataview list.

If I use the proxy and set the rootProperty to my items list, I then lose the ability to access the single balance figure. If I don't set it, how do I ensure that the list uses the transaction items property on the store? Normally, the whole store itself is set to the dataview list, but I need to be able to set a sub-set of items off the store to the list.

How can this be achieved in Sencha Touch?

Sample json:

    Balance: "£430",
    Transactions: [
       { TransactionDate: "1/1/2013", Credit: 300, Debit: 0, Balance: 300 },
       { TransactionDate: "3/1/2013", Credit: 130, Debit: 0, Balance: 430 }

I'd like the underlying dataview list to use the 'Transactions' property whilst being able to access the single Balance property off the store so this can be set on a label within the view.

share|improve this question
can you post sample json structure of clear idea ? –  SachinGutte Feb 14 '13 at 17:41
added sample json, thanks. –  jaffa Feb 14 '13 at 17:59

1 Answer 1

As you stated, you can not apply store directly to list so you'll have to listen for store load event. Then after loading, get required enumerable object in an array and set it as data to list. You can try -

         // do stuff here

Or there's another way, I had answered some what same question here . Requirement is somewhat same. You can try that too.

share|improve this answer
In the store.each() function, what is the best way of then binding that data to the list? –  jaffa Feb 15 '13 at 12:27

Your Answer


