1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    3
    Vote Rating
    0
    Pine is on a distinguished road

      0  

    Default Unanswered: Can't render a list

    Unanswered: Can't render a list


    I have a simple MVC Sencha Touch application, with 1 store, 2 models and 2 views - a toolbar and a list. My toolbar renders fine, but the list does not. No exception is thrown and I can't find what I'm doing wrong.


    The store (Books.js):
    Code:
    Ext.define('App.store.Books', {
        extend: 'Ext.data.Store',
        model: 'App.model.Book',
        autoLoad: true,
        data: [
        { id: '1', name: '1984', publisher: 'Orwell' },
        { id: '2', name: 'Biography',  publisher: 'abcde' },
        { id: '3', name: 'The Old Man and the Sea',  publisher: 'Hemingway' }
        ]
    });
    The view (List.js - I have another Bar.js which renders fine):
    Code:
    Ext.define('App.view.List', {
        extend: 'Ext.List',
        store : 'Books',
        xtype : 'mylist',
        itemTpl: '<div><strong>Name: {name}</strong>Publisher: {publisher}</div>'
    });
    The viewport (Viewport.js) - extends Ext.Container as I saw in several examples:
    Code:
    Ext.define('App.view.Viewport', {
        extend: 'Ext.Container',
        requires : [
            'App.view.Bar',
            'App.view.List'
        ],
        config: {
            fullscreen: true,
            layout: 'fit',
            items: [
            {
                xtype : 'toolbar',
                docked: 'top'
            },
            {
                xtype: 'mylist'
            }
            ]
        }
    });
    As I wrote - my toolbar is shown, my list ('mylist') isn't. What am I missing or doing wrong?

    Disclosure: earlier today I posted the question in another forum, but haven't got an answer yet.

    Thanks!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,117
    Vote Rating
    454
    Answers
    3159
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You need to put the store and itemTpl in the config object
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

Tags for this Thread