开发者

Sencha-touch : toolbar with buttons auto height

开发者 https://www.devze.com 2023-03-06 18:43 出处:网络
My problem, is how can I initiate a panel with a bottom toolbar with vertical buttons. Here is my code

My problem, is how can I initiate a panel with a bottom toolbar with vertical buttons.

Here is my code

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,                        
                    }
                ],
            });

It works because I specify a height: '100', but I want to specify an auto height or no height. When I specify 'auto' for height property, the buttons are small and align on left, AND when I click on one, he's (the button) strech!!!

So, how can I use height: 'auto' for toolbar with buttons with same width (strech automatically)?


Type

defaults : {
    flex : 1
}

in your's toolbar properties

0

精彩评论

暂无评论...
验证码 换一张
取 消