简体   繁体   中英

Not able to align ExtJS buttons vertically on right.

I am using extjs and fabric canvas to generate the below panel,unfortunately I am not able to align all these buttons: 在此处输入图片说明

vertically as in the picture below using just extjs: 在此处输入图片说明

Suggestions:

  1. you can set the width of all buttons equal and give equal left padding from the image.

  2. you can use left the vertical menu-bar and place the buttons in it and modify CSS to remove its border so that it can become invisible.

    you can make 2 vbox in items and in first place image and in second half place buttons.

it's not looking good because of unequal width and space between buttons.for more help please provide code.

You need to use layout properties like vbox and hbox , here's the example:

FIDDLE (press Run if image doesn't load properly)

Ext.create({
xtype: 'container',
layout: {
    type: 'hbox',
    align: 'stretch'
},

items: [{
    xtype: 'imagecomponent',
    width: 500,
    alt: 'img1',
    src: 'https://i.imgur.com/Y3GKYOF.png'
}, {
    xtype: 'container',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    defaults: {
        margin: 5
    },
    items: [{
        xtype: 'button',
        text: 'Circle'
    }, {
        xtype: 'button',
        text: 'Box'
    }, {
        xtype: 'button',
        text: 'Arrow'
    }, {
        xtype: 'button',
        text: 'TextBox'
    }, {
        xtype: 'button',
        text: 'TextArea'
    }, {
        xtype: 'button',
        text: 'Delete'
    }, {
        xtype: 'button',
        text: 'Save'
    }]
}],
renderTo: Ext.getBody()
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM