1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    4
    Vote Rating
    0
    Fabriciogs is on a distinguished road

      0  

    Default Panel width

    Panel width


    My problem is: when i add a panel in container, the panel width is 100%, but i want, the panel width, is a title width or a content width.

    var panel = Ext.widget('panel');
    panel.height = 100;
    panel.title = "dkadjoawduioahduiahduia";

    container.add(panel);

    the container is 100% of layout;

  2. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,197
    Vote Rating
    482
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You will need to provide/calc a width, or it will default to the size of the container.

    Code:
    var container = Ext.create('Ext.container.Container', {
        width: 400,
        height: 200,
        renderTo: Ext.getBody(),
        border: 1,
        style: {borderColor:'#000000', borderStyle:'solid', borderWidth:'1px'}
    });
    
    var panel = Ext.widget('panel');
    panel.height = 100;
    panel.width = 100; // calc width of title
    panel.title = "dkadjoawduioahduiahduia";
    
    container.add(panel);
    Scott.

Thread Participants: 1