2013-04-11 64 views
1

我基本上在製作2個水平面板來分割ipad屏幕。在sencha觸摸面板中顯示列表

我想顯示左側面板中的列表和右側面板中的詳細視圖,但任何我沒有得到列表。

下面

是我使用的視圖:

Ext.define("Sencha.view.Main", { 
extend: 'Ext.Container',  
config: { 

layout: 'hbox', 

    items: [ 
    { 
     xtype: 'panel', 
     width: 300, 
     items: [ 

       { 
        xtype: "list", 
        id:'contactlist', 
        store:'Items', 
       } 
       ], 
    }, 
    { 
     xtype: 'panel', 
     html: 'Message Detail view goes here ....' 

    } 
] 
} 

});

下面是我使用的店:

Ext.define('Sencha.store.Items', { 
extend: 'Ext.data.Store', 

config: { 
    model: 'Sencha.model.Item', 
    defaultRootProperty: 'items', 
    root: { 
     items: [ 
      { 
       text: 'Drinks', 

      }, 
      { 
       text: 'Snacks', 

      } 
     ] 
    } 
} 

});

+0

您可能需要指定'height',因爲這不是'fit'佈局,容器也沒有指定任何高度。 – ThinkFloyd 2013-04-12 08:40:04

回答

1

我想你可能會丟失在列表中的柔性配置選項,在煎茶文檔和itemTpl

{ 
     xtype: "list", 
     id:'contactlist', 
     flex: 1, 
     itemTpl: {text}, 
     store:'Items', 
} 

文檔指出: 「此項目的彎曲,如果這個項目項目是一個分機內.layout.HBox或Ext.layout.VBox佈局。「

也沒有爲商店設置storeId。 storeId:'Items',