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: tree opens in a particular state
doonee
Member

Posts: 10
Registered: 3/6/2005
Member Is Offline
posted on 3/6/2005 at 07:54 AM Reply With Quote
tree opens in a particular state


hi all

hope someone can help me out

Id like to know, and im sure it has been asked before,
how can configure the tree to open in a particular state.
For example:

HOME
+subject1
+subject2
--already expanded1
--already expanded2
--already expanded3
+subject3
+subject4

(it would be ok for me, in this case here, for this particular state to be default, that is, to always appear like that)

is there any simple way to do that in the free version ?

thanks in advance +best regards

doonee
View User's Profile View All Posts By User U2U Member
Dor
Junior Member

Posts: 4
Registered: 5/23/2005
Member Is Offline
posted on 5/23/2005 at 08:24 PM Reply With Quote

I needed the same functionality, so I've made a hack to TTM that makes it possible.
Take a look at attachment.

Modification is based on this (http://www.softcomplex.com/forum/viewthread_290/) code & can be improved :) but 4 my purposes it's enough.
usage is slightly modified too - when calling a tree method use next syntaxys:
new tree (TREE_ITEMS, TREE_TPL, unfold_first, unfold_last);
where 2 first parameters are well known :) unfold_first and unfold_last means positions in array between which nodes should be unfolded.

in fact, much better solution would be giving a tree an array with positions in array of nodes wich should be unfolded, but I'm a little lazy :) And I do not really need this :)

Attachment: modified_TTM.txt (5.92kb)
This file has been downloaded 958 times
View User's Profile View All Posts By User U2U Member
Dor
Junior Member

Posts: 4
Registered: 5/23/2005
Member Is Offline
posted on 5/24/2005 at 12:44 PM Reply With Quote

I've found that my modification does not complitly fits my demands so I made one more hack. This time I'm using array of nodes positions that should be unfolded.
usage:
new tree (TREE_ITEMS, TREE_TPL, UNFOLD_ITEMS);
where UNFOLD_ITEMS is smthg like that:
UNFOLD_ITEMS = [ 0,10,21,25 ];
this number are node positions in array TREE_ITEMS.
NB! all nodes should open from parent to descendant. otherwise only parent will be unfolded.

I'm not JS guru, so my script have a weak point: function tree MUST get an array UNFOLD_ITEMS or you'll get error: "length is null or not an object". In IE script still workin, but error is always error :)
can somebody add a right check so it would be possible call
new tree (TREE_ITEMS, TREE_TPL); - no unfolding
OR
new tree (TREE_ITEMS, TREE_TPL, UNFOLD_ITEMS);
???????
sorry, but I cannot :(

Attachment: modified_TTM.txt (5.93kb)
This file has been downloaded 891 times
View User's Profile View All Posts By User U2U Member
JamieT
Junior Member

Posts: 3
Registered: 8/9/2005
Member Is Offline
posted on 8/9/2005 at 09:36 AM Reply With Quote
A little help Dor?


Hi Dor,

Hope you are still around. I too need to open the tree menu with particular nodes open and whilst I understand the principle of ywhat you are doing with your code, I need a little help with a couple of things :)

If you respond to this post, I will provide more detail of where I'm having a problem :)

Thanks

Jamie
View User's Profile View All Posts By User U2U Member
JamieT
Junior Member

Posts: 3
Registered: 8/9/2005
Member Is Offline
posted on 8/9/2005 at 10:26 AM Reply With Quote
Sorted


Worked it out... :)

Cheers
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
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
   

Go To Top


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