2013-11-26 47 views
0

我修改了代碼,如this,我添加了一些項目,因爲我想用滾動來獲取div,但它在Sencha中不起作用! 有什麼建議嗎? 在此先感謝!Sencha - div不滾動

代碼:

/*global Ext:false */ 
Ext.application({ 
    launch: function() { 
     Ext.create('Ext.Container', { 
      fullscreen: true, 
      styleHtmlContent: true, 
      data: [{ 
       fname: 'Stratton', 
       lname: 'Sclavos', 
       role: 'Executive Chairman' 
      }, 
etc. ], 
       tpl: '<div style="overflow: auto; overflow-y: auto;"><tpl for="."><div><strong>{lname}</strong>, {fname} <em class="muted">({role})</em></div></tpl></div>' 
      }); // create() 
     } // launch 
    }); // application() 
+0

你說的是煎茶觸摸?如果是這樣,你應該爲你的問題添加一個「sencha-touch」標籤......並且下一次,你還應該在問題或標題中明確地說出它。 – rixo

回答

3

地址:

scrollable : { 
    direction  : 'vertical' 
}, 

像這樣:

/*global Ext:false */ 
Ext.application({ 
    launch: function() { 
     Ext.create('Ext.Container', { 
      fullscreen: true, 
      styleHtmlContent: true, 
      scrollable : { 
       direction  : 'vertical' 
      }, 
      data: [{ 
       fname: 'Stratton', 
       lname: 'Sclavos', 
       role: 'Executive Chairman' 
      }, 
etc. ], 
       tpl: '<div style="overflow: auto; overflow-y: auto;"><tpl for="."><div><strong>{lname}</strong>, {fname} <em class="muted">({role})</em></div></tpl></div>' 
      }); // create() 
     } // launch 
    }); // application() 
+0

謝謝!有用! –

+0

@ImanOdor你會介意在這種情況下接受答案嗎?:) – benka