[ 41 posts ] Go to page Previous1, 2, 3, 4, 5 Next

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Mon Jan 10, 2011 6:38 pm
+0-
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.

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Mon Jan 10, 2011 6:53 pm
+0-
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.

vamsee_vanaparthy

  • Joined: Wed Jan 12, 2011 1:26 pm
  • Posts: 3
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Wed Jan 12, 2011 1:31 pm
+0-
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

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Treeview notes

Post Posted: Wed Jan 12, 2011 1:46 pm
+0-
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

vamsee_vanaparthy

  • Joined: Wed Jan 12, 2011 1:26 pm
  • Posts: 3
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Wed Jan 12, 2011 1:53 pm
+0-
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);
});

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Thu Jan 20, 2011 12:27 pm
+0-
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.

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Thu Jan 20, 2011 12:37 pm
+0-
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.

vamsee_vanaparthy

  • Joined: Wed Jan 12, 2011 1:26 pm
  • Posts: 3
  • Offline
  • Profile

Re: Treeview notes

Post Posted: Thu Jan 20, 2011 12:52 pm
+0-
Actually did the same thing use after instead of on :) thanks anyway for the support. Tree view is cool!

james.little

  • Username: james_little
  • Joined: Sun Sep 04, 2011 11:12 pm
  • Posts: 3
  • Offline
  • Profile
Tags:

Re: Treeview notes

Post Posted: Sun Sep 04, 2011 11:38 pm
+0-
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

Gonzalo Cordero

YUI Developer

  • Username: gonzalocordero
  • Joined: Fri Jul 31, 2009 2:23 pm
  • Posts: 16
  • Location: Y! Front End engineer
  • Twitter: goonieiam
  • GitHub: goonieiam
  • Gists: goonieiam
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Treeview notes

Post Posted: Tue Sep 06, 2011 10:02 am
+0-
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();
});
  [ 41 posts ] Go to page Previous1, 2, 3, 4, 5 Next
Display posts from previous:  Sort by  
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