Threaded View

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


    Default 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:
    SimpleSafeHtmlCell<String> cell = new SimpleSafeHtmlCell<String>(
            SimpleSafeHtmlRenderer.getInstance(), "") {
        public void render(Context context, String data, SafeHtmlBuilder sb) {
            if (data.equals("Beethoven")) {                    
            } else {
            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