RadTreeView: Add class to node containter - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

RadTreeView: Add class to node containter

  • RadTreeView: Add class to node containter
  • 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>
  • 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