[SOLVED] How to set other icon for tree root node?

UI Components for JSF
Post Reply
User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

10 Jun 2010, 18:49

Hello community,

Does anybody know what is the best way to set a custom icon for root node in the tree component? Just for root node, other nodes must stay untouched. I can set icons for leafs programmatically, but what is about root node?

Thanks in advance.
Last edited by Oleg on 14 Jun 2010, 11:09, edited 1 time in total.
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

14 Jun 2010, 11:09

Here is a CSS based solution if somebody needs it

Code: Select all

.ygtvdepth0 .ygtvtm,
.ygtvdepth0 .ygtvtmh {
	background: url(../img/tmRoot.gif.jsf?ln=themes) 1px 0 no-repeat;
}

.ygtvdepth0 .ygtvtp,
.ygtvdepth0 .ygtvtph {
	background: url(../img/tpRoot.gif.jsf?ln=themes) 1px 0 no-repeat;
}

.ygtvdepth0 .ygtvlm,
.ygtvdepth0 .ygtvlmh {
	background: url(../img/lmRoot.gif.jsf?ln=themes) 1px 0 no-repeat;
}

.ygtvdepth0 .ygtvlp,
.ygtvdepth0 .ygtvlph {
	background: url(../img/lpRoot.gif.jsf?ln=themes) 1px 0 no-repeat;
}
Important is the class "ygtvdepth0".
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Jun 2010, 14:04

Cool, thanks for sharing Oleg.

ridvan
Posts: 5
Joined: 11 Mar 2011, 18:20

11 Mar 2011, 18:24

Hi Oleg.

What about ONLY the tree leaves?
How can I change them?

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 53 guests