Append item with icon

2 posts, 0 answers
  1. Rinaldo
    Rinaldo avatar
    2 posts
    Member since:
    Aug 2012

    Posted 08 Aug 2012 Link to this post

    Dear,
    I've a treeview with icons as your sample, similar this:
    <ul id="treeview" id="myRoot">
    <li data-expanded="true"><span class="k-sprite folder"></span>Folder1</li>
    <li data-expanded="true"><span class="k-sprite folder"></span>Folder2</li>
    <li data-expanded="true"><span class="k-sprite folder"></span>Folder3</li>
    </ul>

    Then I've try to use append method (link to button for example), similar this:
    treeView.append({ text: "Folder4" }, $("#myRoot"));
    (it's work but the new node Folder 4 have no icon)

    My question is:
    How can I append a new node with icon ?
    I have try this:
    treeView.append({ text: "<span class='k-sprite folder'></span>Folder4" }, $("#myRoot"));
    But not work!

    Thanks for help,
    Rinaldo

  2. Rinaldo
    Rinaldo avatar
    2 posts
    Member since:
    Aug 2012

    Posted 08 Aug 2012 Link to this post

    If I can help somebody, I've resolved in this way:
    treeView.append({ text: "<span class='k-sprite folder'></span>Folder4", encoded: false }, $("#myRoot"));

    Bye,
    Rinaldo
Back to Top