Hybrid View

  1. #1
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Answers
    3
    Vote Rating
    0
    juworld is on a distinguished road

      0  

    Default Answered: List - how to bind to a subfield in the store

    Answered: List - how to bind to a subfield in the store


    Hi All!


    New to touch! Love it so far!


    I have this question regarding how work around store.


    So I have this "question" object from JSON that reads like this:


    PHP Code:
    {
        
    "responseData":[
            {
                
    "decision":
                {
                    
    "question":"Is the position a manager position?",
                    
    "type":"multi",
                    
    "choices":[
                        {
    "text":"A managerial position"},
                        {
    "text":"An skilled\/specialized position"}]
                }
            }
        ]





    The store, I set the root property to responseData.decision. This way I can access to question, type, and choices.


    However, in the View, I want to to have a list that is bind to choices.




    PHP Code:
    Ext.define('GS.view.GetStarted', {
        
    extend'Ext.navigation.View',
        
    xtype'gspanel',


        


        
    config: {
            
    title'Get Started',
            
    iconCls'action',


            
    items: {
                
    xtype'list',






                
    title'Let\s get started!',


                
    store'decisionstore',


                
    // I want to bind to choices
                
    itemTpl'{choices}'
            
    }
        }
    }) 


    But, this approach is obviously wrong… because in the browser, I see [object Object],[object Object]. Please advice!


    Thanks in advice!!!


    Justin

  2. Hi all!

    One solution that I came up with is the need of 2 stores. I need a store to load my decision object and another store to load my "choices".

    I came across this site: http://www.sencha.com/learn/grid-faq...JAX_request.3F that shows how to load multiple stores with one json call (I don't think I would want to call the same JSON twice =P).

    That fixed it!

    Thanks!

    Justin

  3. #2
    Sencha User
    Join Date
    Apr 2013
    Posts
    7
    Answers
    3
    Vote Rating
    0
    juworld is on a distinguished road

      0  

    Default


    Hi all!

    One solution that I came up with is the need of 2 stores. I need a store to load my decision object and another store to load my "choices".

    I came across this site: http://www.sencha.com/learn/grid-faq...JAX_request.3F that shows how to load multiple stores with one json call (I don't think I would want to call the same JSON twice =P).

    That fixed it!

    Thanks!

    Justin

Tags for this Thread