1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    2
    Vote Rating
    0
    dilberted is on a distinguished road

      0  

    Question Unanswered: Unable to bind the store to Ext.List/Panel

    Unanswered: Unable to bind the store to Ext.List/Panel


    I have this blocking issue and I cannot move on further, the data is getting loading in the store (checked through chrome console). But unable to load / bind the data in the list.

    Currently in the code below, I am using the panel and then trying to load the data in the items. But I have also tried to use Ext.List instead of the panel but to no avail.

    In my code below, I am not setting the root of the json or the record as there is no root.

    Hope anyone can help me out.

    Here is the code for the Model and the store
    Code:
    Ext.regModel('Itemsor', {
        fields: [
            {name: 'text', type: 'string'},
            {name: 'created_at', type: 'string'},
            {name: 'retweeted', type: 'string'}
        ]
    });
    
    App.StoreItems = new Ext.data.Store({
        model: 'Itemsor',
        proxy: {
            type: 'scripttag',
            url : 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=digg',
            reader: {
                type: 'json'
            }
        },
    });
    
    App.StoreItems.load();

    Here is the code for the view
    Code:
    App.views.TimelineIndex =  Ext.extend(Ext.Panel, {
        layout : 'fit',
        scroll : 'vertical',
        items: [{
                    xtype : 'list',
                    store: 'App.StoreItems',
                    itemTpl: '{text}, <span class="date">{created_at}</date>',
                    singleSelect : true,
                    itemSelector : 'span.id',
                    onItemDisclosure : function(record, btn, index) {
                            
                    }
        }],
    });
    Ext.reg('TimelineIndex', App.views.TimelineIndex);

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,541
    Vote Rating
    872
    Answers
    3565
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    You have:

    Code:
    store: 'App.StoreItems',
    If you pass a string then it will look at StoreManager to find a storeId of that string which your store doesn't have.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread