This support forum belongs to the YUI3-Treeview Gallery Module.
| Page 2 of 5 | [ 41 posts ] | Go to page Previous1, 2, 3, 4, 5 Next |
|
Stjepan:
Thanks for the feedback, once again. I really appreciate it. Sorry it's taken me a while to respond, but I've been out on vacation and just came back. To answer some of your questions: - I'll look into adding the clicking on label/toggle control configurable. - As for the custom icons, you could add a custom class to override the default css rules and specify your own icons. - I updated the example on my site and added a treeleaf click handler. Take a look and let me know if you have any questions. Notice how it's running the latest YUI 3.3.0 preview. That's probably why you were seeing those errors in your code, you need to update to the the preview version of YUI in order to work with the latest version of treeview. |
|
One more thing, about being notified when a focus event occurs on a treenode, have you tried to subscribe to a focus event? treeleaf:focus?
Thanks. |
|
Hey Guys, I have requirement to message(crossframe) the offsetHeight of the expanded or collapsed tree.
I have tried subscribing to the event toggleTreeState, but when I calculate the offsetHeight of the ID its always reports the previous but not the expanded ones. Can you please let me know how can I capture the rendered state Current height, can I listen to any event? Any Ideas? Thanks |
|
Vamsee:
Thanks for trying Treeview out! What do you mean by it always returns the previous tree? does it return the Tree where the toggle event happened? Thanks |
|
Gonzalo:
Thanks for the response. I meant when I click on the labels to expand or collapse the tree I want to ideally get the expanded or collapsed height rather than old height that subscribing to toggleTreeState give us. I was wondering if we could somehow get the expanded or collapsed offsetHeight for the (#mytree)? See the sample code of what I am trying to do treeview.on("toggleTreeState", function(e) { var ul = Y.one("#mytree"); var hUL = ul.get('offsetHeight'); var wUL = ul.get('offsetWidth'); console.log(hUL); var frameName = "top", message = {msgid :"PortletSizeConfig", config:{width: wUL, height:hUL}}, config = { "proxy" : "xxxxxx", "reverseProxy" : "xxxxxx", "eventType" : "hcs:portletmsg", "callback" : function (o) { } }; var jsonString = Y.JSON.stringify(message); Y.CrossFrame.postMessage(frameName, jsonString, config); }); |
|
Got it,
Yeah it seems like I'm going to have to expose an "after" event to capture the moment right after a tree has been expanded. Let me put that in for you, I'll submit a CDN push today. |
|
Actually, there is no need for that, you could just do this:
treeview.after("toggleTreeState",function(e) { console.log(e.currentTarget.get("boundingBox").get("offsetHeight")); }); That should give you what you're looking for. |
|
Actually did the same thing use after instead of on
|
|
i've worked with yui 3.4 for just a couple of weeks, so some questions i got
might be stupid, but i really need to use yui3-treeview to build a dynamic load tree, i will be really appreciate if someone can help me solve my problem source code is as follows: YUI().use(['gallery-yui3treeview', 'io-base', 'node'], function(Y){ var selectorStr = '#mytree'; var treeview = new Y.TreeView({ srcNode: selectorStr, contentBox: selectorStr, boundingBox: selectorStr, type: 'TreeView' }); treeview.on("treeview:toggleTreeState", function(e) { // ajax var uri = "/resource/ajax/queryChild?id=2&type=0"; // send request var request = Y.io(uri); // Define a function to handle the response data. function complete(id, o) { var id = id; // Transaction ID. var data = o.responseText; // Response data. alert(data); }; Y.on('io:complete', complete, this); }); treeview.render(); }); the problem is, after a initilize a tree, i add events to the Yui instance, then i click on the folder node, the times of alert(data) dialogue-box increases the same as the times i click on the folder node. eg, i click the 1st time, the dialogue-box 1 time, i click the 2nd time, the dialogue-box 2 times, i click the 3rd time, dial-box 3 times i dont where my problem is. thank u very much |
|
James:
Try this(basically take the Y.on() out of the tree view:toggleTreeState, as you're attaching it each it time you toggle the tree. Hope it helps treeview.on("treeview:toggleTreeState", function(e) { // ajax var uri = "/resource/ajax/queryChild?id=2&type=0"; // send request var request = Y.io(uri); // Define a function to handle the response data. }); function complete(id, o) { var id = id; // Transaction ID. var data = o.responseText; // Response data. alert(data); }; Y.on('io:complete', complete, this); treeview.render(); }); |
| Page 2 of 5 | [ 41 posts ] | Go to page Previous1, 2, 3, 4, 5 Next |
| 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