| Page 1 of 1 | [ 4 posts ] |
|
I'm new to YUI and can't figure out how to make the inline edit select the contents by default when it is activated. I am applying it to a new tree branch that is a text node by calling the editNode(); node function. The inline editor appears but because the contents aren't selected so I have to delete the existing contents before typing the new name in the box.
Is there a function I can all to highlight the contents of the inline editor box? Code: //Called from a keylistener function key_test() { var branch = new YAHOO.widget.TextNode({label: 'name', editable:true}, treeRoot, false); tree.render(); branch.editNode(); //activate the inline editor to change the node name } |
Alberto SantiniYUI Contributor
|
Hello jono.
Did you give a look at Inline Editing of TreeView Node Labels example [1]? It seems the content is selected by default. Hope that helps, IceBox [1] http://developer.yahoo.com/yui/examples ... _edit.html |
|
Hi IceBox,
Yes I saw this example and the inline editor appears with the contents selected when activated like this: Code: tree.subscribe('enterKeyPressed',tree.onEventEditNode) However, when the inline is activated with a key listener like this, it doesn't work as expected. Am I missing something or is this a bug? Code: var key_ctrlN = new YAHOO.util.KeyListener(document, { ctrl:true, keys:78 }, { fn:key_test, scope:tree, correctScope:true } ); key_ctrlN.enable(); |
Alberto SantiniYUI Contributor
|
Hello jono.
The method fillEditorContainer [1] selects the text. For a better explanation about that method you can read the topic "best approach for complex and huge forms using treeview" [2]. Regards, IceBox [1] http://developer.yahoo.com/yui/docs/YAH ... rContainer [2] viewtopic.php?f=89&t=1979&view=previous |
| Page 1 of 1 | [ 4 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group