Sochettra / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

ability to set Folder Icon #204

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
So far, I know that we can set node.data.icon easily.
But I'm not sure if we can set the same for Folder Icon? Because folder has 2 
states (icons): expanded & collapsed.

I know we can use CSS to set folder icon, *but* I'd like to set customized 
icons (both states) for *each* folder. Is that possible to do such thing?

Great work! Thanks.

Original issue reported on code.google.com by mrdu...@gmail.com on 4 Jun 2011 at 12:11

GoogleCodeExporter commented 8 years ago
I think this can be done by adding custom classes for your folders (using 
`addClass`) and than have your own extended CSS definitions for it.

Original comment by moo...@wwwendt.de on 6 Jun 2011 at 5:40

GoogleCodeExporter commented 8 years ago
I have a ContextMenu 'change icon' for both nodes & folders. User will be able 
to set different icons for each of them, so 'addClass' won't work here...

Original comment by mrdu...@gmail.com on 6 Jun 2011 at 7:26

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 5 Jul 2011 at 7:44

GoogleCodeExporter commented 8 years ago
If you have a Dynatree node you can do
   $(node.span).addClass("custom1");

The node object can be retrieved from 
 - Dynatree event argument
 - $("#tree").dynatree("getActiveNode");
 - $.ui.dynatree.getNode(element)

Original comment by moo...@wwwendt.de on 5 Jul 2011 at 4:00

GoogleCodeExporter commented 8 years ago
sample:
http://jsfiddle.net/mar10/eTmVU/

Original comment by moo...@wwwendt.de on 16 Aug 2011 at 5:38

GoogleCodeExporter commented 8 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:16

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:19