1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    351
    Vote Rating
    4
    gkatz is on a distinguished road

      0  

    Default Square Panel/container?

    Square Panel/container?


    HiI need to produce a square container (height=width). I need the "square boxes' below to really be square.in the example below the width of the container should be shortened and more background green should be shown...
    here is a sencha fidle code http://www.senchafiddle.com/#BLJRC that draws the image below.I am not sure where to start here. is there a simple css way of achieving this? I have tried reading the square boxes getParent().getSize() in order to see what the parent height is but that returned null for some reason...any suggestions?thanks!


    Untitled.jpg
    Attached Images

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Using a box layout you won't have access to that. You can listen to the resize event to see if it fires and then update the height
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Nov 2010
    Posts
    351
    Vote Rating
    4
    gkatz is on a distinguished road

      0  

    Default


    Using a box layout you won't have access to that
    Hi;
    I am a bit confused here. what do you mean by box layout. vbox and hbox? will it work if I put fit layout instead?
    aren't the getSize/getHeight/getWidth supposed to return the actual dims of a component? I cant even get the dims of the container after it has been layed out...
    note that my only need is to have a square with the correct size once its placed for the first time. I don't need it to be stretchable or change size in anyway after that.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    433
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    You need to execute on the element.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.