1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    8
    Vote Rating
    1
    gruyen is on a distinguished road

      0  

    Default How do I get clientheight of a panel before rendering it? (Alt: max-height w/ scroll)

    How do I get clientheight of a panel before rendering it? (Alt: max-height w/ scroll)


    I have a Grid inside a ContentPanel. I want the ContentPanel to expand in height to a certain point before forcing the Grid to scroll; if I set the height of the ContentPanel, it will render at that height even if the Grid is empty, which looks weird. ContentPanel only has setHeight, not setMaxHeight; and, the max-height CSS attribute doesn't appear to trigger scrolling. So, I have the following hack:

    Code:
    public void onCompleteEdit(CompleteEditEvent<Value> event) {
            store.commitChanges();
            if (panel.getOffsetHeight() > height) {
                panel.setHeight(height);
            }
    Every edit event in the grid triggers a check, and scroll bars "turn on" once the grid has sized to the desired length. So while building the initial dataset it works fine; however when initially loading the table already populated with data, I can't find a way to check to see if the height should be set. (I've tried onShowEvent and onResizeEvent; neither are triggered during a normal render.)

    Is there a better way to achieve this than my hack? If not, what event can I trigger on?

    Thanks

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Posts
    8
    Vote Rating
    1
    gruyen is on a distinguished road

      0  

    Default


    Bump

  3. #3
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,731
    Vote Rating
    90
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    The clientHeight and offsetHeight properties are defined as the sizes after rendering - these values cannot make sense until the html elements have been drawn, and the browser given the chance to complete rendering. Until it is rendered, the individual html elements do not have a size. This is how the browser works - we don't define these properties in GWT or GXT, we read them from the browser.

    If you just want to know the size after show, call show(), then check the size. If you want to attach an event handler, consider listening for a show event, or an attach event, and checking size there. It may be necessary to wait a moment (i.e. schedule a 'finally' or 'deferred' command) to wait for the rest of the show behavior to complete before a size will be available.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi