Getting child node list of specific type("rel")

73 views
Skip to first unread message

Venu

unread,
Apr 7, 2009, 10:40:34 AM4/7/09
to jsTree
Hi,
Is there any way that i can get the list of all child nodes of a
selected node which are of a particular type?

type:
$(NODE).attr("rel")--gets the type of a particular node

my xml tag:
<item id="2" parent_id="1" rel="type"><content><name >child</name></
content></item>

i tried something like this, not worked.. pls help
var leafletnodes= new Array();
$(NODE).find(("li").attr("rel")=="type").each(function (i) {
leafletnodes.push(this.id);
});

vakata

unread,
Apr 7, 2009, 1:37:58 PM4/7/09
to jsTree
Hi,

I could try:
$(NODE).find("> ul > li[rel=type]");

Best regards,
Ivan

Venu

unread,
Apr 9, 2009, 8:13:50 AM4/9/09
to jsTree
Thanks Ivan,
I find my problem solved.. Can there be something for looking up the
tree level also from the level of the selected node? I tried to
replace the ">" by "<" ;) but failed.

Regards,
Venu
> > });- Hide quoted text -
>
> - Show quoted text -

Venu

unread,
Apr 9, 2009, 8:24:37 AM4/9/09
to jsTree
Hi Ivan,
I think it wud be nice if u could share us some more information about
the final tree node structure(HTML ui li format) for that the
developers can play around with that as per there requirement

Regards,
Venu
> > - Show quoted text -- Hide quoted text -

vakata

unread,
Apr 9, 2009, 1:44:23 PM4/9/09
to jsTree
@Venu
Just check the documentation (under output) - I believe it is properly
documented. I would also recommend a developer tool like Firebug or
dragonfly, to monitor the tree structure "live" if you need to!

As for the parents - just go with:
$(NODE).parents("li") - that will give you the "path" to the node.

Best regards,
Ivan
Reply all
Reply to author
Forward
0 new messages