[ 4 posts ]

John Bercik

YUI Contributor

  • Username: coachz
  • Joined: Thu May 14, 2009 6:52 am
  • Posts: 31
  • GitHub: coachz
  • Gists: coachz
  • IRC: coachz
  • Offline
  • Profile

Treeview folder icon bug ?

Post Posted: Mon Mar 15, 2010 3:49 pm
+0-
I'm unable to get a folder icon to be displayed on a folder that has no children. The example given by Yahoo has children for every node but my code has folders that don't all have children. Thanks for any help.

http://imgur.com/n1CZm

http://developer.yahoo.com/yui/examples ... style.html

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview folder icon bug ?

Post Posted: Tue Mar 16, 2010 1:09 am
+0-
The example you point out behaves exactly like yours, it doesn't have any folder icon on those nodes that have no children.

If you look at: http://developer.yahoo.com/yui/treeview/#style you can see the classnames assigned to the different types of nodes. For those nodes that have no children, which end with an 'n', the css file stored in assets/css/folders/tree.css has the width set to 17px instead of the 34px that takes the connecting lines plus the icon, thus allowing no space for the later.

Set the width for those classnames to 34px and an there will be space for an icon. Then you have to change the background image to one that actually has a folder, but you will have to draw that one. You could merge the tn and ln gifs with one of the others that do have a folder.

John Bercik

YUI Contributor

  • Username: coachz
  • Joined: Thu May 14, 2009 6:52 am
  • Posts: 31
  • GitHub: coachz
  • Gists: coachz
  • IRC: coachz
  • Offline
  • Profile

Re: Treeview folder icon bug ?

Post Posted: Tue Mar 16, 2010 3:41 am
+0-
Is this a bug? MenuNode indicates that a node is a folder. If type MenuNode has no children it should have a folder icon displayed. For type Text, they should not have a folder icon.

Thanks for the help Satyam.


[{"type":"MenuNode","label":"glossary","children":[{"type":"Text","label":"ccop_glossary.xml"},{"type":"MenuNode","label":"ccop_glossary_converted","children":[{"type":"Text","label":"ccop_glossary.rtf"}]}]},{"type":"MenuNode","label":"software","children":[{"type":"MenuNode","label":"01","children":[{"type":"Text","label":"D01_text_entities.xml"}]}]},{"type":"MenuNode","label":"system","children":[{"type":"MenuNode","label":"03","children":[{"type":"Text","label":"F03_001_jwics_text_entities.xml"},{"type":"Text","label":"F03_ssaa_jwics_text_entities.xml"}]}

Satyam

YUI Contributor

  • Username: Satyam
  • Joined: Tue Dec 09, 2008 12:34 am
  • Posts: 2016
  • Location: Sitges, Spain
  • GitHub: Satyam
  • Gists: Satyam
  • IRC: DevaSatyam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview folder icon bug ?

Post Posted: Tue Mar 16, 2010 4:15 am
+0-
A MenuNode is a TextNode the doesn't allow multiple nodes expanded, whether it is a MenuNode or a TextNode it makes no difference regarding what type of icon is shown. It all depends on the CSS styles assigned to the classnames that code the node status. The node definition you show above says nothing about that.
  [ 4 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum