1. #1
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default Populating Trees

    Populating Trees


    I have a question which might help me to understand the new Loader/Reader/Store/Tree/Binder design a bit better:

    I have a TreeModel which I would like to see on 2 different Trees.
    The first Tree only shows leafs (a list then), the other Tree all elements.

    When using myGWT I used the ContentProvider to define which elements should go on the Tree. Right now, I tried to use a filter but parent elements are always shown if a child is shown.

    What would be the correct solution in this case? Is there an equivalent to the former ContentProvider which I have missed?

    Cheers

  2. #2
    Ext User
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    larvelljones is on a distinguished road

      0  

    Default Initial Check State

    Initial Check State


    Along the same lines .. I used to be able to set the initial checked state of a checkable tree item through the previously available content provider. It doesn't look like the Store/Binder/Tree pattern lets you set the initial state or I'm missing how. What is the correct way to do this?

    Thanks!

  3. #3
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Jepp, I would need initial checked-state, too...

  4. #4
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Another one: How to set checked state of TreeItems in general?
    There was a Tree.setChecked(TreeItem, boolean state) in former versions of GXT.

    Where do I find it now, or do I have to ask the TreeBinder to retrieve the TreeItem and then set the state?

    In general: I think the Binder should have more functionality regarding this stuff (e.g. it should work similar like the ContentProvider before) as it is the link between the model and the Tree...

  5. #5
    Ext User
    Join Date
    May 2008
    Posts
    21
    Vote Rating
    0
    larvelljones is on a distinguished road

      0  

    Default Initial Check State - workaround

    Initial Check State - workaround


    As a workaround..

    I re-introduced a Checkable interface
    Code:
    public interface Checkable {
        public boolean isChecked();
        public void setChecked(boolean b);
    }
    And added the following change to TreeBinder to set the initial checked state.

    Code:
    12a13,14
    > import ....Checkable;
    > 
    191a194,196
    >     if (model instanceof Checkable && ((Checkable)model).isChecked()) {
    >       item.setChecked(true);
    >     }

  6. #6
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Thnx, copied this workaround

    EDIT: No, actually I decided to implement a Synchronizer to adopt the checked state of the model - a bit nasty but it does the job for now:

    Code:
    public void synchronize() {  
                int rootCount = model.getChildCount();
                for (int i=0; i<rootCount; i++) {
                    AClientModelItem rootChild = (AClientModelItem)model.getChild(i);
                    update(rootChild);
                }
            }
            
            private void update(AClientModelItem item) {
                int count = item.getChildCount();
                for (int i=0; i<count; i++) {
                    AClientModelItem child = (AClientModelItem)item.getChild(i);
                    update(child);
                }
                // Set checked state according to model
                Component c = binder.findItem(item);
                if (c instanceof TreeItem) {
                    TreeItem ti = (TreeItem)c;
                    if(ti.isChecked() != item.isRenderedChecked()) {
                        ti.setChecked(item.isRenderedChecked());
                    }
                }
            }
    What is the official answer to these issues? Are there some API changes for next realease concerning TreeBinder?

    Thanks in advance

  7. #7
    Sencha User
    Join Date
    May 2008
    Location
    Germany
    Posts
    59
    Vote Rating
    0
    LukasP is on a distinguished road

      0  

    Default


    Is there someone out there who can help us/me with these issues?

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