1. #1
    Ext User
    Join Date
    Nov 2008
    Posts
    4
    Vote Rating
    0
    dpcowx is on a distinguished road

      0  

    Question TreeTable within TabPanel -- possible bug

    TreeTable within TabPanel -- possible bug


    Hi Guys,

    I've been playing around with TreeTable and found that when it's added to a GWT TabPanel, the table data isn't displayed. Taking a peak in Firebug, I've found that the '.my-treetbl-data' style has it's width property always set to 0 when the TreeTable is within a TabPanel.

    Details: gxt-1.2, Windows.

    I've copied and pasted the sample class TreeTableExample from http://extjs.com/explorer/#treetable (line for line within zero changes to the onRender() method). I've also got the FileService service setup to return a view of my local file system; this is all fine and dandy and everything is great until the tree table goes into a TabPanel.

    Here's my entry point:

    public void onModuleLoad() {
    TabPanel tp = new TabPanel();
    tp.add(new HTML("Some stuff"), "Tab 1");
    tp.add(new TreeTableExample(), "Tab 2");
    RootPanel.get().add(tp);
    }

    When this is done. The contents of the tree table are empty. Is this a bug or am I missing something here?

    Thanks,
    Daniel

  2. #2
    Ext User
    Join Date
    Nov 2008
    Posts
    4
    Vote Rating
    0
    dpcowx is on a distinguished road

      0  

    Default


    I've found the problem...

    Apparently, tables don't recalculate their layout if their size has not been changed since the last time calculations were run; regardless of whether those calculations were valid at the time they were run. In my case, when the TreeTable is added to the document and rendered, it's on the non-selected tab (would be a similar situation if you're using a GXT cardpanel), so the width always returns 0.

    See TreeTableView::resize() where the call to 'int width = treeTable.getOffsetWidth();' is made. This line is causing the width of the data portion of the table to be set to 0, so although the content is correctly loaded into the treetable, you can't see it.

    The fix is easy after figuring all this out. Just call:

    table.recalculate();

    To force the table to recalculate and update it's sizes (e.g. when you actually activate that tab/cardpanel).

    Cheers,
    Daniel

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