Results 1 to 5 of 5

Thread: Treepanel and folder icon

  1. #1

    Default Treepanel and folder icon


    I've got a question for you :

    I have a tree panel which work fine ( thanks Jack! ) but it still a little problem.

    I set an icon to a node with cls and it's OK. The problem is when its node has a child, the icon become the folder icon. I don't want it. I'de like to keep my custom icin, even if the node has a child.

    Is there a way to do it or not?

    Thanks for your response.

  2. #2


    That is because the node gets the 'folder' class per default if it has or gets childnodes.

    You can offcourse change the folder class in the stylesheet, or you can override the updateExpandIcon function to change the behaviour as you want it.

    Good luck!

  3. #3
    Ext User
    Join Date
    Mar 2007


    $nodes[] = array('text' =>'foo', id=>'bar', cls=>'folder'), change it to your class in your backend

  4. #4


    OK Thanks.

    How can i overwrite this method. Can you write an example please?


  5. #5
    Ext JS Premium Member simeon's Avatar
    Join Date
    Mar 2007
    Austin, Texas


    "cls": "message"
    to your Json

    This will over ride the icon for both open and closed node.

    .message .x-tree-node-icon {
      background-position: 64px 0px; 
    Note the above css uses a sprite image for all of the tree icons for performance. If yours is just a single gif you don't need the bckground-position,

    If you wanted to use a different icon for the default expanded I used this:

    .x-tree-node-expanded .x-tree-node-icon {
      background-position: 128px 0px; 


Similar Threads

  1. Hiding the Menu Icon
    By jon.whitcraft in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 21 May 2011, 5:47 PM
  2. Minor css bug date icon
    By glauff in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 22 Feb 2007, 4:25 PM
  3. Tree: Turning a leaf into a folder?
    By eargang in forum Ext 1.x: Help & Discussion
    Replies: 8
    Last Post: 19 Feb 2007, 6:48 PM
  4. Tree folder becomes leaf
    By seldon in forum Ext 1.x: Help & Discussion
    Replies: 6
    Last Post: 6 Jan 2007, 4:38 PM
  5. UpdateManager wait icon
    By techno_adi in forum Ext 1.x: Help & Discussion
    Replies: 4
    Last Post: 6 Nov 2006, 6:33 AM

Posting Permissions

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