Jstree rename issue. inline editor opens above root node

Viol3nce

New Member
Folks I am having an issue with rename and JsTree. I have created a JS Fiddle to highlight the issue. http://jsfiddle.net/KJYrs/. My scenario is that I'd like to validate that the entered name is not a default name or contains special characters. When I try to fire the rename event after the initial failed attempt the inline editor appears above the root node.\[code\]<script type="text/javascript" class="source">$(function () { $("#demo1").jstree({ "plugins": ["themes", "html_data", "ui", "crrm", "contextmenu"] }).bind("rename.jstree", function (event, data) { //let's assume I do some vaidation here and it fails //so I want to rename until valid if (event.type === 'rename') { $("#demo1").jstree("deselect_all"); $("#demo1").jstree("select_node", "#" + data.rslt.obj[0].id); $("#demo1").jstree("rename"); } });});</script><div id="demo1" class="demo"> <ul> <li id="phtml_1"> <a href="http://stackoverflow.com/questions/15859954/#">Root node 1</a> <ul> <li id="phtml_2"> <a href="http://stackoverflow.com/questions/15859954/#">Child node 1</a> </li> <li id="phtml_3"> <a href="http://stackoverflow.com/questions/15859954/#">Child node 2</a> </li> </ul> </li> <li id="phtml_4"> <a href="http://stackoverflow.com/questions/15859954/#">Root node 2</a> </li> </ul></div>\[/code\]Any help or suggestions would be greatly appreciated.
 
Back
Top