Вложенный список My Sencha Touch не показывает данные, только в полноэкранном режиме: правда?

почему в моем вложенном списке не отображаются данные, они отображаются только в fullscreen:true ,

new Ext.Application({
    launch: function() {
        new Ext.Panel({
            fullscreen: true,
            items: [],
            dockedItems: [
                {
                    xtype:'panel',
                    dock: 'left',
                    width:300,
                    items:[nestedList],
                    style: 'border-right:1px solid #042040;'
                },
                {
                    xtype: 'toolbar',
                    title: 'Sencha Touch ',
                    dock: 'top'

                }

            ]

        });
    }
});



var data = {
     text: 'Groceries',
    items: [{
        text: 'Drinks',
        items: [{
             text: 'Water',
            items: [{
                text: 'Sparkling',
                leaf: true
        },{
            text: 'Still',
            leaf: true
        }]
    },{
        text: 'Coffee',
        leaf: true
    },{
        text: 'Espresso',
        leaf: true
    },{
        text: 'Redbull',
        leaf: true
    },{
        text: 'Coke',
        leaf: true
    },{
        text: 'Diet Coke',
        leaf: true
    }]
},{
    text: 'Fruit',
    items: [{
        text: 'Bananas',
        leaf: true
    },{
        text: 'Lemon',
        leaf: true
    }]
},{
    text: 'Snacks',
    items: [{
        text: 'Nuts',
        leaf: true
    },{
        text: 'Pretzels',
        leaf: true
    },{
        text: 'Wasabi Peas',
        leaf: true
    }]
},{
    text: 'Empty Category',
    items: []
}]
};

Ext.regModel('ListItem', {
     fields: [{name: 'text', type: 'string'}]
});

var store = new Ext.data.TreeStore({
    model: 'ListItem',
    root: data,
    proxy: {
        type: 'ajax',
        reader: {
            type: 'tree',
            root: 'items'
    }
}
});

var nestedList = new Ext.NestedList({
    title: 'Groceries',
    displayField: 'text',
    //fullscreen:true, // only with this turned on?
    store: store
});

person Davor Zubak    schedule 19.09.2011    source источник


Ответы (1)


Это необходимо, чтобы знать, как составить список. Попробуйте вместо этого установить layout: 'auto'. Но таким образом вы не сможете использовать cardSwitchAnimation, поэтому список не будет вложенным, то есть ничего не произойдет, если вы нажмете на элемент списка.

В любом случае, что вы пытаетесь сделать?

person ilija139    schedule 19.09.2011