Threaded View

  1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    45
    Vote Rating
    0
    raivis is on a distinguished road

      0  

    Default Unanswered: Tree - more that one icon for leaf/folder cells

    Unanswered: Tree - more that one icon for leaf/folder cells


    Hello all!

    I was wondering how can one set more than one leaf/folder icon for the Tree widget in gxt v3? The only way I've found out is by overriding cells render method:
    Code:
    SimpleSafeHtmlCell<String> cell = new SimpleSafeHtmlCell<String>(
            SimpleSafeHtmlRenderer.getInstance(), "") {
    
    
        @Override
        public void render(Context context, String data, SafeHtmlBuilder sb) {
            if (data.equals("Beethoven")) {                    
                tree.getStyle().setNodeCloseIcon(Resources.IMAGES.myimage1());
                tree.getStyle().setNodeOpenIcon(Resources.IMAGES.myimage1());
            } else {
                tree.getStyle().setNodeCloseIcon(Resources.IMAGES.myimage2());
                tree.getStyle().setNodeOpenIcon(Resources.IMAGES.myimage2());
            }
            super.render(context, data, sb);
        }                                
    };
    But somehow I doubt that's the best way. In Senchas gxt demo explorer you can see, that they are using more than one icon for leaves (open some UI Binder example and switch to source tab. You can see different icons for different file types in a file tree), but there are no examples on achieving this.

    p.s. This is definitively not the correct way to do this, because it does not behave like I suspected. Another way of doing it is to append the icon to SafeHtmlBuilder in render method, but still, not sure that's the way it should be.
    Last edited by raivis; 25 Nov 2011 at 1:36 AM. Reason: src code is not doing what I suspected it would

Thread Participants: 1

Tags for this Thread

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