How can I add a trash icon to a Tree List?
- View SourceHello -
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.
- View SourceTry this:
background: transparent url( lib/icons/trash.png ) no-repeat;
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.