Loading ...
Sorry, an error occurred while loading the content.

How can I add a trash icon to a Tree List?

Expand Messages
  • jaemsjohn
    Hello - I would like to add a trash icon to the right of my tree list. I figure this would be the easiest way to give the user the ability to delete an item. I
    Message 1 of 2 , Apr 1 5:26 PM
    View Source
    • 0 Attachment
      Hello -

      I would like to add a trash icon to the right of my tree list. I figure this would be the easiest
      way to give the user the ability to delete an item. I would like it so that the icon is far enough
      to the right and fixed (flushed right) to look very nice.

      Any help would be greatly appreciated.

      Otherwise if anyone has working code to implement a drag and drop into a trash can that
      would do too.

      thanks
    • bruskuta
      Try this: .icon-trash { padding-right: 18px; background: transparent url( lib/icons/trash.png ) no-repeat; background-position: right; } this is with a picture
      Message 2 of 2 , Apr 3 7:45 AM
      View Source
      • 0 Attachment
        Try this:

        .icon-trash
        {
        padding-right: 18px;
        background: transparent url( lib/icons/trash.png ) no-repeat;
        background-position: right;
        }

        this is with a picture that is 16 x 16 pixels. Change the padding and
        picture location to fit your needs, then add the class to the tree you
        want like this...

        var trash = new YAHOO.widget.TextNode( trashConfig, parentNode, false );
        important--> trash.labelStyle = 'icon-trash';

        It should work in both IE and FF, I tested both.
      Your message has been successfully submitted and would be delivered to recipients shortly.