Results 1 to 7 of 7

Thread: 2.0 M3: Tree icons disappear

  1. #1
    Ext User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
      0  

    Question 2.0 M3: Tree icons disappear

    After upgrading from M2 to M3 and using TreePanel my tree icons (arrows, open/closed folder) are gone. Is it possible some images were not included in the release or is there something I need to add in code to use the default icons?

    Thanks,

  2. #2
    Sencha User
    Join Date
    Aug 2008
    Posts
    129
    Vote Rating
    0
      0  

    Default

    I have also updated a project from M2 To M3 however the default folders were fine without modifcation. The leaf nodes however were not as the method
    setLeafIconStyle has now it seems been replaced by
    setLeafIcon which means you have to use the
    Code:
    IconHelper.create("Css_style_name")
    to use css classes directly on the leaf nodes.

    Otherwise you set up a interface of Imagebundle like the explorer example does
    Code:
    package com.extjs.gxt.samples.client.icons;
    import com.google.gwt.user.client.ui.AbstractImagePrototype;
    import com.google.gwt.user.client.ui.ImageBundle;
    public interface ExampleIcons extends ImageBundle {
      @Resource("table.png")
      AbstractImagePrototype table();
      
      @Resource("music.png")
      AbstractImagePrototype music();
    }

  3. #3
    Ext User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default Looking at that javadocs....

    Shouldn't TreePanel be using the IconSupport interface?

  4. #4
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    132
      0  

    Default

    No. That would say that the treepanel itself would have an icon, which is not the case.

  5. #5
    Ext User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default

    True, yet FormPanel, ContentPanel, CollapsePanel all implement that interface.

  6. #6
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    132
      0  

    Default

    Yes, as all three you mentioned support an icon on the top left.

  7. #7
    Ext User
    Join Date
    May 2009
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Let me backup a bit, this is probably just a simple syntax question:

    This was working with M2 and seemed to use the default icons

    Code:
    TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
            tree.setIconProvider(new ModelIconProvider<ModelData>() {
                public String getIcon(ModelData model) {
                    return null;
                }
            });
    M3 changed the API and this satisfies the compiler but there are no icons.

    Code:
            
    TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
            tree.setIconProvider(new ModelIconProvider<ModelData>() {
                public AbstractImagePrototype getIcon(ModelData model) {
                    return null;
                }
            });
    I assume something is wrong in code, could you maybe point me in the right direction?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •