[flexcoders] Re: Expanding Tree Node Based On Attribute Match
Did you look at my example? Thanks, and I did, but I couldn't pick out anything that would help, at least noting that I am not already doing. It's part of a huge Flex app (well, huge to me, 110+ class files so far), so what part would you like me to post? I'm not sure what information you're missing. As I posted, it does return the right node, as evidenced when I trace out with toXMLString() - but when I tell it to expand based on that node, it simply doesn't. I'm happy to post more, I just don't know what you need. Jason
RE: [flexcoders] Re: Expanding Tree Node Based On Attribute Match
Ok, are you doing what I do in the line right after I find the node? Which node are you testing with? Is the root node expanded when you test? Is the node you are trying to expand visible when you test? How are you assigning the dataProvider to the tree? From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Sent: Friday, July 18, 2008 2:22 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Expanding Tree Node Based On Attribute Match Did you look at my example? Thanks, and I did, but I couldn't pick out anything that would help, at least noting that I am not already doing. It's part of a huge Flex app (well, huge to me, 110+ class files so far), so what part would you like me to post? I'm not sure what information you're missing. As I posted, it does return the right node, as evidenced when I trace out with toXMLString() - but when I tell it to expand based on that node, it simply doesn't. I'm happy to post more, I just don't know what you need. Jason
[flexcoders] Re: Expanding Tree Node Based On Attribute Match
I'm working on answering your questions - may not get to them before the weekend, but meanwhile, why did you say, attribute() method is safer than @? Just curious - I'm always eager to learn.. Jason
RE: [flexcoders] Re: Expanding Tree Node Based On Attribute Match
If you use @label in an e4x expression, and if any of the nodes in the xml does not have the label attribute, the expression will error. If you use the attribute(label) syntax it will not error. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Sent: Friday, July 18, 2008 3:25 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Expanding Tree Node Based On Attribute Match I'm working on answering your questions - may not get to them before the weekend, but meanwhile, why did you say, attribute() method is safer than @? Just curious - I'm always eager to learn.. Jason
[flexcoders] Re: Expanding Tree Node Based On Attribute Match
If you use @label in an e4x expression, and if any of the nodes in the xml does not have the label attribute, the expression will error. If you use the attribute(label) syntax it will not error. Good to know, thanks. Jason
[flexcoders] Re: Expanding Tree Node Based On Attribute Match
Thanks Tracy, that got me really close to wrapping this up. I was able to find the node and isolate it, however the tree is not expanding that node. var topic:String = Add Skill; var xmlListSearch:XMLList = xml.menuTree..folder.(attribute(topic) == topic); var foundNode:XML = xmlListSearch[0]; trace(xml: + foundNode.toXMLString()); //traces the node I want: folder label=Adding Skills topic=Add Skill / navTree.expandItem(foundNode, true, true);//does not expand the node found above The id of the tree is indeed navTree. Not sure what's happening here. Thanks in advance, Jason
[flexcoders] Re: Expanding Tree Node Based On Attribute Match
--- In flexcoders@yahoogroups.com, Jason [EMAIL PROTECTED] wrote: Thanks Tracy, that got me really close to wrapping this up. I was able to find the node and isolate it, however the tree is not expanding that node. var topic:String = Add Skill; var xmlListSearch:XMLList = xml.menuTree..folder.(attribute (topic) == topic); var foundNode:XML = xmlListSearch[0]; trace(xml: + foundNode.toXMLString()); //traces the node I want: folder label=Adding Skills topic=Add Skill / navTree.expandItem(foundNode, true, true);//does not expand the node found above The id of the tree is indeed navTree. Not sure what's happening here. Thanks in advance, Jason Any ideas anyone? I'm stumped! Thanks.
RE: [flexcoders] Re: Expanding Tree Node Based On Attribute Match
Did you look at my example? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Sent: Thursday, July 17, 2008 5:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Expanding Tree Node Based On Attribute Match --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Jason [EMAIL PROTECTED] wrote: Thanks Tracy, that got me really close to wrapping this up. I was able to find the node and isolate it, however the tree is not expanding that node. var topic:String = Add Skill; var xmlListSearch:XMLList = xml.menuTree..folder.(attribute (topic) == topic); var foundNode:XML = xmlListSearch[0]; trace(xml: + foundNode.toXMLString()); //traces the node I want: folder label=Adding Skills topic=Add Skill / navTree.expandItem(foundNode, true, true);//does not expand the node found above The id of the tree is indeed navTree. Not sure what's happening here. Thanks in advance, Jason Any ideas anyone? I'm stumped! Thanks.
RE: [flexcoders] Re: Expanding Tree Node Based On Attribute Match
I ask because you haven't posted enough code to see what might be wrong. I have two ideas, but there is no point in just guessing. Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Tracy Spratt Sent: Thursday, July 17, 2008 5:44 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Expanding Tree Node Based On Attribute Match Did you look at my example? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Sent: Thursday, July 17, 2008 5:03 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Expanding Tree Node Based On Attribute Match --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Jason [EMAIL PROTECTED] wrote: Thanks Tracy, that got me really close to wrapping this up. I was able to find the node and isolate it, however the tree is not expanding that node. var topic:String = Add Skill; var xmlListSearch:XMLList = xml.menuTree..folder.(attribute (topic) == topic); var foundNode:XML = xmlListSearch[0]; trace(xml: + foundNode.toXMLString()); //traces the node I want: folder label=Adding Skills topic=Add Skill / navTree.expandItem(foundNode, true, true);//does not expand the node found above The id of the tree is indeed navTree. Not sure what's happening here. Thanks in advance, Jason Any ideas anyone? I'm stumped! Thanks.