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

TreeView Inline Editor Help

1 Answer 92 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jamie
Top achievements
Rank 1
Veteran
Jamie asked on 24 Jun 2015, 05:55 PM

I understand that inline editing is not something that is supported by the TreeView and I've seen other solutions in the forums where people created work-arounds for this.  I'm trying to work on my own work-around to create actual inline editing using the tree view but I'm having issues I'm hoping someone can help with.

 Essentially I've created a template that wraps the data in a span tag, then on the double click event of that span i replace the html contents of the data with code for a text box.  My intent is that I then use the blur event of the text box to save the data into the treeview data and get rid of the textbox.

The problem I'm having though is that when the text box is created, I can't actually click into it.  I'm wondering if one of the events of the TreeView is hijacking the click event and redirecting focus elsewhere which essentially never lets the textbox get focus.  Anyone (especially the Telerik devs) have any ideas why this could be happening?

1 Answer, 1 is accepted

Sort by
0
Jamie
Top achievements
Rank 1
Veteran
answered on 24 Jun 2015, 06:35 PM
I guess I just needed a little more elbow grease.  For anyone else trying to do this, the issue is indeed with the the focus being stolen.  Seems as though the treeview node takes focus when you click on anything in the node (including the textbox i embeded).  I was able to work around this by doing .focus().select() to manually assign focus and select the textbox contents.  Since I'm saving the data on the blur anyway i dont need to handle future clicks but for testing i did confirm that you could also manually call the focus in the tree views select event to handle that.
Tags
TreeView
Asked by
Jamie
Top achievements
Rank 1
Veteran
Answers by
Jamie
Top achievements
Rank 1
Veteran
Share this question
or