How to add border for Container in ExtJS

Duleep picture Duleep · Apr 8, 2013 · Viewed 15.3k times · Source

I have Container look like below. I want to add border for this Container like text box border please help to add border for the Container.

MyContainer13Ui = Ext.extend(Ext.Container, {
    flex: 1,
    width: 500,
    height: 22,
    activeItem: 0,
    id: 'url',
    initComponent: function() {
        MyContainer13Ui.superclass.initComponent.call(this);
    }
});

Answer

Sasha Brocato picture Sasha Brocato · Jun 18, 2013

If you can't just set border: true in the configuration, try this:

 MyContainer13Ui = Ext.extend(Ext.Container, {
    flex: 1,
    width: 500,
    height: 22,
    border: 1,
    style: {
       borderColor: 'black',
       borderStyle: 'solid'
    },
    activeItem: 0,
    id: 'url',
    initComponent: function() {
        MyContainer13Ui.superclass.initComponent.call(this);
    }
});