Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: determine if a node has children
syfodyas
Member

Posts: 11
Registered: 11/16/2005
Member Is Offline
posted on 12/2/2005 at 11:48 AM Reply With Quote
determine if a node has children


In pro version, I build the following for selecting children of an node:

function selectChildren (o_item) {

var o_iss = o_item.a_config[2];
o_iss['i0'] = 'icons/folderoverdis.gif'; //change icon
o_item.o_root.toggle(o_item.n_id); //close node

if(typeof(o_item.a_children[0]) != 'undefined') { //has children
for (var i=0; i<o_item.a_children.length; i++){
o_item.a_children.a_config[2]['i0'] = 'icons/folderoverdis.gif'; //change icon
}
}
return true;
}

using 'hs':'selectChildren' in tree scope

It all works fine until i select a leaf instead of a node. it keeps telling me that o_item.a_children has no properties. Can someone tell me what you guys programmed to return in case when no array of children exist, 'cause the folowing line terminates my script and i can't find a way to determine if a node has children

if(typeof(o_item.a_children[0]) != 'undefined') { //has children

thanx
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 12/6/2005 at 05:09 PM Reply With Quote

Try
if(o_item.a_children) { //has children
instead of
if(typeof(o_item.a_children[0]) != 'undefined') { //has children
View User's Profile View All Posts By User U2U Member
syfodyas
Member

Posts: 11
Registered: 11/16/2005
Member Is Offline
posted on 12/8/2005 at 02:59 PM Reply With Quote

None of that worked

I placed 'isLeave':true in the item scope setting

if(o_item.a_config[2]['isLeave']!='true') {
for (var i=0; i<o_item.a_children.length; i++){
o_item.a_children.a_config[2].select();
}
}

combining with PHP defining its a leave, but its a workarround and not optimal...
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 12/8/2005 at 05:41 PM Reply With Quote

Tt's tree's control internal method to determine node, so it should work properly
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Tigra Tree Menu
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   
Tigra Tree Menu PRO
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004