Skip to content Skip to sidebar Skip to footer

How Do I Get A Folder Icon On All The Parent Nodes And Folder Plus Icon On All The Child Nodes(icon Shoulbe On Left Side)

I want to get icons before the nodes of the Parent node and the child nodes. For parent nodes it should be icomoon-icon-folder-plus and for child nodes it should be 'icomoon-icon-f

Solution 1:

Not entirely sure what do you want to achieve, but from the question i grasp that you wanted to

  1. "get icons before the nodes" Does it mean place/put icon before the node ? i assumed yes cmiiw
  2. and for parent node which have hasChildren attribute you want to put icomoon-icon-folder-plus, on the child node to put icomoon-icon-folder

So here i go

  1. If you wanted to put it before the node instead of using template, i need to use the databound function.
  2. From databound function you look through all <li></li> then loop through all of them and create conditional if(hasChildren){ logic } else { logic}

I haven't been able to use the template for such a purpose so this is the best way i could achieve it. and here is the jsFiddle

Solution 2:

You can look at the list-style-image CSS property.

ul {
  list-style-image: url('sqpurple.gif');
}

See examples and more information here - http://www.w3schools.com/cssref/pr_list-style-image.asp

Solution 3:

Created a template instead a datasource.

 # if (item.type= "true") { #

}

Post a Comment for "How Do I Get A Folder Icon On All The Parent Nodes And Folder Plus Icon On All The Child Nodes(icon Shoulbe On Left Side)"