This is a migrated thread and some comments may be shown as answers.

Append item with icon

1 Answer 81 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rinaldo
Top achievements
Rank 1
Rinaldo asked on 08 Aug 2012, 03:33 PM
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

1 Answer, 1 is accepted

Sort by
0
Rinaldo
Top achievements
Rank 1
answered on 08 Aug 2012, 05:00 PM
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
Tags
TreeView
Asked by
Rinaldo
Top achievements
Rank 1
Answers by
Rinaldo
Top achievements
Rank 1
Share this question
or