2012-09-16 22 views
0

我想添加背景到選項卡面板中的列表。但只要我使佈局合身,背景消失......如果我刪除佈局,列表中消失..sencha列表背景圖像與佈局適合

名單似乎只能當佈局適合出現......

可以在任何一個幫忙?

PLZ感謝...

**************************** Bollist.js ********************** 

    Ext.define('tabla.view.Bollist', 
{ 
    extend:'Ext.Panel', 
    xtype:'Bollist', 
    config:{ 
     title:'Bols', 
     iconCls:'music2', 
     layout:'fit', 
     items:[ 
      { 
       xtype:'list', 
       store:'BolStore', 
       itemTpl:'{name}' 
      } 
     ] 
    } 
}); 

    *************** Main.js ************** 

    Ext.define("tabla.view.Main", { 
extend: 'Ext.tab.Panel', 
requires: [ 
    'Ext.TitleBar', 
    'Ext.dataview.List' 
], 
config: { 
    tabBarPosition: 'bottom', 

    items: [ 
     { 
      style:{ 
       backgroundImage:'url(resources/images/bg.png)', 
       backgroundRepeat:'repeat', 
       backgroundPosition:'center', 
       backgroundSize:'cover' 
      }, 
      xtype:'home' 
     }, 
     { 
      style:{ 
       background:'red', 
       backgroundRepeat:'repeat', 
       backgroundPosition:'center', 
       backgroundSize:'cover' 
      }, 
      xtype:'Bollist' 
     } 
    ] 
} 

});

Ext.define('tabla.store.BolStore',{ 
extend:'Ext.data.Store', 
config: 
{ 
    model:'tabla.model.Bol', 
    data:[ 
     { name: 'Na/Ta' }, 
     { name: 'Ti' }, 
     { name: 'Tin' }, 
     { name: 'Ri'}, 
     { name: 'Ge' }, 
     { name: 'Ka/Kat'}, 
     { name: 'Dha'}, 
     { name: 'Dhi'}, 
     { name: 'Dhin'}, 
     { name: 'Toon'} 
    ] 
} 

});

回答

0

試試這個方法,這對我來說很合適。在的index.html

 style:{ 
      background:'red', 
      backgroundRepeat:'repeat', 
      backgroundPosition:'center', 
      backgroundSize:'cover' 
     } 

添加CSS文件這樣的:

從列表中刪除風格

<link href="app.css" rel="stylesheet" type="text/css" /> 

在你app.css添加以下代碼:

.x-list 
{ 
    background:'red'; 
} 

希望這會有所幫助。