RadTreeView: Add class to node containter

Posted by Community Admin on 05-Aug-2018 15:05

RadTreeView: Add class to node containter

All Replies

Posted by Community Admin on 04-Jun-2011 00:00

I need to add a class to a node's container - the <li> tag that contains the node content.  I see that I can add classes with the following properties:
- CssClass
- ContentCssClass
- SelectedCssClass

But I can't find any way to add a class to the <li> tag that contains the node.  I want it to look like this:

<li class="rtLI first MY-CSS-CLASS-GOES-HERE">
  <div class="rtTop rtSelected">
    <span class="rtSp"></span><a class="rtIn" href="campaign">Campaign</a>
  </div>
  <ul class="rtUL"></ul>
</li>

Posted by Community Admin on 09-Jun-2011 00:00

Hello Craig,


If you want to appy styles to all of the li items you can just use the following selector:

.RadTreeView .rtUL .rtLI
 


If you need this selector for different purposes than styling you can apply it with jQuery
$(document).ready(function()
        $(".RadTreeView .rtUL .rtLI").addClass("YourClassName");
)

If you want to apply a class to specific item you can also do it on document.ready:

$(document).ready(function()
        $(".RadTreeView .rtUL .rtLI").eq(3).addClass("YourClassName");
)




All the best,
Jordan
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed