1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    4
    Vote Rating
    0
    lukasw is on a distinguished road

      0  

    Default Measuring height of siblings...

    Measuring height of siblings...


    Hello,

    I have following problem. I need the script that will return me sum of heights of elements that are in the same container as control in parameter, ofcourse without this control.

    For example I have container that contains 3 controls:

    Code:
    GridPanel - height: 150px;
    SomeOtherPanel - height: 200px;
    Toolbar - height: 50px;
    now what I need is to invoke method like:

    Code:
    var siblingsHeight = MesureSiblingsHeight(GridPanel)
    which will return me 250 to my siblingsHeightvariable.

    How to write such method? Any examples? I've tried.. no success

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I don't think you really need this.

    I think you need to use a layout manager.

    Like hbox or vbox, depending on your requirements. Which you have not specified.

  3. #3
    Ext User
    Join Date
    Jul 2010
    Posts
    4
    Vote Rating
    0
    lukasw is on a distinguished road

      0  

    Talking


    I'm not using extjs it directly, but throught the .net port called ext.net, and I'm not sure if standard solution will work, but anyway what I need is to have grid which will allways fill the gap between two panels (at the top, and at the bottom).

    The panels could have diffrent height dependent of the form, so I don't know theirs heights. I need the grid to always be precisely big so the bottom toolbar will always stick to bottom panel and the headers bar always stick to top panel. The grid can have much more rows then it can be shown on the page - in this situation it must has scrollbar.

    Also it have not to be extra containers and such because it will be used too many times, and i cannot make it abstract because its all on aspx pages.

    What kind of layout can I use in extjs? I will adapt the solution to ext.net

    Thanks in advice

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    That's a vbox layout using

    Code:
    layout: {
        type: 'vbox',
        align: stretch
    },
    items: [
        topPanelWithConfiguredHeight,
        gridPanelwithFlex_1,
        bottomPanelWithConfiguredHeight
    ]
    Configure the top and bottom with a fixed height, and your grid in the middle with

    Code:
    flex: 1

  5. #5
    Ext User
    Join Date
    Jul 2010
    Posts
    4
    Vote Rating
    0
    lukasw is on a distinguished road

      0  

    Default


    Bad news.. I cannot implement it like this in ext.net
    The request for script that I asked about in my first post is still actual..

  6. #6
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Why not? You have 3 components in a Container. The Container must have some layout. So use vbox. To do otherwise is to waste time. All these calculations are done for you.

  7. #7
    Ext User
    Join Date
    Jul 2010
    Posts
    4
    Vote Rating
    0
    lukasw is on a distinguished road

      0  

    Default


    I'm using it, as I said, in ext.net.

    Now vbox in ext.net does not accept items other then ext server controls. Problem is that some controls that I'm using are custom server controls and to use it I have to encapsulate them into some ext containers. When we multiply this operation by the ~30 pages that I have, the better way is to make one script that will compute heights and rest in piece

Similar Threads

  1. Replies: 2
    Last Post: 9 Dec 2009, 8:24 AM
  2. problem with minWidth/Height and maxWith/Height in resizable Object
    By TAG in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 18 Aug 2009, 11:34 PM
  3. fit grid height to windows/viewport height
    By dahool in forum Ext 2.x: Help & Discussion
    Replies: 16
    Last Post: 12 Nov 2008, 6:20 AM
  4. Auto-height & Max-height combination not working
    By acemaverick in forum Ext 2.x: Help & Discussion
    Replies: 5
    Last Post: 12 Sep 2008, 8:48 AM

Thread Participants: 1