2011-05-17 73 views
3

我的问题是,如何启动带有垂直按钮的底部工具栏的面板。Sencha-touch:带有按钮自动高度的工具栏

这里是我的代码

var filterActionsButtons = [ 
      { 
       ui : 'confirm', 
       text: 'Apply for current view',    
      }, 
      {    
       ui : 'action', 
       text: 'Apply and Save in your profile', 
      }, 
      { 
       ui: 'decline', 
       text: 'Cancel', 
       handler: function() { 
        filterPanel.hide(); 
       } 
      }   
     ]; 

     var filterPanel = 
      new Ext.Panel({ 
       fullscreen: true, 
       modal: true, 
       floating: true, 
       centered: true, 
       //width: Ext.is.Phone ? 260 : 400, 
       //height: Ext.is.Phone ? 260 : 400, 
       //autoWidth: true, 
       layout: 'fit', 
       scroll: 'vertical', 
       html: '<h2>Agencies</h2>...', 
       dockedItems: [ 
        { 
         xtype: 'toolbar', 
         dock: 'top',       
         title:'Manage your filters',       
        }, 
        { 
         xtype: 'toolbar', 
         dock: 'bottom',      
         layout: { 
          type: 'vbox',       
          align: 'strech',        
         }, 
         height: '100', 
         //height: 'auto', 
         items: filterActionsButtons,       
        } 
       ], 
      }); 

它的工作原理,因为我指定的高度:“100”,但我想指定自动高度或无高度。当我为高度属性指定'auto'时,按钮很小,左边对齐,当我点击一个按钮时,他就是(按钮)拉链!

那么,如何使用高度:'自动'工具栏与相同宽度的按钮(自动strech)?

回答

1

类型

defaults : { 
    flex : 1 
} 

在你的工具栏属性

+0

如果垂直工具栏的高度不足以容纳所有的按钮,你的答案会缩水每个按钮。不是我正在寻找的解决方案。 – Arvin 2014-02-28 01:47:18