0

I'm trying to generate a Kendo UI treeview markup and make use of dragging and dropping nodes around. The problem is that after I drop a node onto another the sprite span element disappears.

Initial HTML markup:

<li>
   <span class='k-sprite'></span>
   <span class='node-text'>Node1</span>
</li>

And here's how a node looks like after dragging & dropping:

<li role="treeitem" class="k-item k-last" data-uid="054713f5-5ba3-444e-a322-72bf86d53ad5" aria-selected="true">
   <div class="k-bot">
     <span class="k-in k-state-selected">Node4</span>
   </div>
</li>

Here's a fiddle: http://jsfiddle.net/BX4VC/

Any idea on how to help Kendo parse the HTML correctly so it preserves the elements inside the node after dragging them around?

Thank you!

lucassp
  • 4,133
  • 3
  • 27
  • 36

1 Answers1

0

There is special handling of the k-sprite class, due to its relation to the spriteCssClass field of the treeview items. If you set an icon class, the spans will be persisted, as seen in the updated fiddle.

Alex Gyoshev
  • 11,929
  • 4
  • 44
  • 74
  • Thanks! Is there a way to add other data to the markup which will be parsed inside the node dataItem property? I want to be able to add in the markup the same properties which I'm using for the append() method. – lucassp Apr 02 '13 at 17:26