| Page 1 of 1 | [ 3 posts ] |
|
I've made YUI TreeView accordingly with this example.
The main problem I have is auto hiding of editor when I click to another component into the same page. Let's say I have menubar and treeview, if I start to edit treeview node and then move focus (doing mouse click for example) to the menubar then my node editor is still on the page. Can I hide node editor automatically after doing the steps above? |
|
I guess that you may set a listener for a click on the document body and if it is not within the editor, you can call method _closeEditor:
http://developer.yahoo.com/yui/docs/YAH ... loseEditor (it is a private method so you have to enable the Show Private Members checkbox to see it). Use Dom's isAncestor to check whether the target of the click has the editor as its ancestor: http://developer.yahoo.com/yui/docs/YAH ... editorData http://developer.yahoo.com/yui/docs/YAH ... editorData _closeEditor allows you to decide whether you want the content edited so far to be saved or ignored. I don't really know how well it works because some other widget might be listening to a click and prevent it from bubbling all the way up to the document body. |
|
Thanks! That works for me.
|
| Page 1 of 1 | [ 3 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