0

I'm currently running with kendo v2012.3.1315 and I am trying to edit a specific node in a tree view without a full tree view update.

I would like to be able to edit the name and have it reflect on the tree and any access to dataitem. Right now, I have been able to just overwrite the html but a) this could change due to template changes and b) when i access the dataitem later, it still has the old text.

The reasoning for this desired functionality is two fold: performance and consistent user interface.

Does anyone know if this is possible?

Thanks.

Paul Sachs
  • 905
  • 2
  • 11
  • 22

1 Answers1

0

Find the element in the tree and update its .html() to the same value it would have if you would redraw the tree.

Gung Foo
  • 13,392
  • 5
  • 31
  • 39
  • That's what I am doing now, but the dataItem method accesses some other internal JS datastructure that then won't match up. I'm looking for a cleaner solution since this code is going to be shared among many developers. – Paul Sachs Feb 14 '13 at 15:00
  • lol. :D cleanest version is probably to update the tree, but i know you don't want to hear this. – Gung Foo Feb 14 '13 at 15:45
  • maybe you can do it by directly changing the datasource. take a look at this function: http://docs.kendoui.com/api/framework/datasource#data – Gung Foo Feb 14 '13 at 15:46
  • Yeah, you are right about the update but I currently want my cake and would like to eat it too. I'm greedy that way. – Paul Sachs Feb 14 '13 at 16:44
  • Looking at the linked docs, it might work. I'll give it a shot. – Paul Sachs Feb 14 '13 at 16:45
  • Turns out, the data() method on the datasource does work. It doesn't change the visual representation which may cause havoc later if the template changes but this works enough for what i need it for. – Paul Sachs Feb 14 '13 at 19:17