尝试将()添加到pabel时,不会出现Sencha List

时间:2014-01-08 21:25:24

标签: sencha-touch

这真的很有线。我在TabPanel中有一个标签,我想在每次用户点击它时刷新它。在选项卡中应该有一个列表。当我试图将列表添加到面板(选项卡容器)时,它只是不显示!当我尝试添加其他东西时,他们正常!

例如:

var listConfiguration = this.getListConfiguration();
var myPanel = Ext.create('Ext.Panel', {
     html: 'This will be added to a Container'
});

Ext.getCmp('Peoplebutton').add(listConfiguration);
Ext.getCmp('Peoplebutton').add(myPanel);

此代码完美地获取html!但是列表没有显示!列表代码工作正常,我已经多次检查过了...... 如果有人可以帮助我,我会很高兴(

列表代码,工作正常

 getListConfiguration: function() {
    var store = Ext.create('Ext.data.Store', {
        fields: ['firstName', 'lastName'],
        sorters: 'firstName',
        autoLoad: true,
         grouper: {
            groupFn: function(record) {
                return record.get('firstName')[0];
           }
        },

        proxy: {
            type: 'ajax',
            url: 'contacts.json'
        }
    });
    return {
        xtype: 'list',
        id: 'list',
        itemTpl: '{firstName} ,{lastName}',
        grouped: true,
        indexBar: true,
        infinite: true,
        useSimpleItems: true,
        variableHeights: true,
        striped: true,
        ui: 'round',
        store: store
    };
}

1 个答案:

答案 0 :(得分:0)

这应该是列表组件高度的问题。

尝试在列表中添加固定高度,或者可以flex:1。

希望有所帮助 -