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 closed when loading page
Mogiin
Newbie

Posts: 1
Registered: 1/21/2004
Member Is Offline
posted on 1/21/2004 at 09:47 PM Reply With Quote
tree closed when loading page


Hello,

I got a question:

When I load my web site , the whole tree and the items are opened.

What must I change in the code so the tree is closed when my web site is loading.
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 1/22/2004 at 01:42 PM Reply With Quote

By default only root node in the tigra tree appeares as opened.
View User's Profile View All Posts By User U2U Member
veloopity
Junior Member

Posts: 3
Registered: 1/22/2004
Location: Germany
Member Is Offline
posted on 1/22/2004 at 03:49 PM Reply With Quote

> By default only root node in the tigra tree appeares as opened


yes ... and I'd like all menu items to appear opened by default. I don't have many menu items in the current app so it seems to make more sense to have them all opened right at the beginning.

Does anyone know what code changes are necessary to do that? I'm trying to wade through the code and understand it but haven't quite managed yet. :-)

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

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 1/22/2004 at 05:40 PM Reply With Quote

Just set
this.b_opened = true;
instead of
this.b_opened = !this.n_depth;
in the function tree_item (tree.js)
View User's Profile View All Posts By User U2U Member
veloopity
Junior Member

Posts: 3
Registered: 1/22/2004
Location: Germany
Member Is Offline
posted on 1/22/2004 at 05:47 PM Reply With Quote

>Just set
>this.b_opened = true;
>instead of
>this.b_opened = !this.n_depth;

I had already tried this because it looked like the most logical thing; however, the branches of the menu tree aren't opened. The effect of this change is only that the plus symbols change into minus symbols, and that the menu _thinks_ that all branches are open. The effect is _not_ that the branches with all subbranches are actually displayed, as if I had clicked on all plus symbols.
So there must be some more statements to modify.
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 1/24/2004 at 12:33 PM Reply With Quote

You're right.
You should init all children items of the open node inside it's div tag.
View User's Profile View All Posts By User U2U Member
veloopity
Junior Member

Posts: 3
Registered: 1/22/2004
Location: Germany
Member Is Offline
posted on 1/28/2004 at 02:06 PM Reply With Quote

> You should init all children items of the open node inside it's div tag.


er ... I'd be grateful for more hints ... init them inside the div tag? that would require that I understand the workings of the javascript ... I only have a very limited understanding of it ... if this can be done with just a little code, I'd be grateful if you could post it ...
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 1/29/2004 at 12:17 PM Reply With Quote

Tigra Tree Menu PRO supports parameter witch allows you to set initial state of the node without any knowledge of javascript.
View User's Profile View All Posts By User U2U Member
Iolai
Member

Posts: 11
Registered: 7/7/2004
Member Is Offline
posted on 7/7/2004 at 08:32 PM Reply With Quote
Solution


I was able to achieve this goal by altering the last line in tree function from
this.a_children.open();
to
this.a_children.open(1);
View User's Profile View All Posts By User U2U Member
esm
Member

Posts: 39
Registered: 1/7/2004
Member Is Offline
posted on 1/11/2005 at 09:06 PM Reply With Quote

this.a_children.open();

Where did you find this string? I did a search in tree.js but it's not there.
View User's Profile View All Posts By User U2U Member
Rikkez
Junior Member

Posts: 3
Registered: 1/17/2005
Member Is Offline
posted on 1/18/2005 at 07:43 AM Reply With Quote
What about the real question?


Hello,

I got a question:

When I load my web site , the whole tree and the items are opened.

What must I change in the code so the tree is closed when my web site is

Rikkez has attached this image:
TREE.jpg - 38.17kb
View User's Profile View All Posts By User U2U Member
esm
Member

Posts: 39
Registered: 1/7/2004
Member Is Offline
posted on 1/18/2005 at 04:54 PM Reply With Quote

I would rather know what to do in order to have the tree opened when the page loads.
View User's Profile View All Posts By User U2U Member
tdodds
Junior Member

Posts: 3
Registered: 1/13/2005
Location: Pittsburgh, PA
Member Is Offline
posted on 2/8/2005 at 02:15 PM Reply With Quote

Put the following in the tree.js

function expand_all () {
for (var i = 1; i < trees[0].a_index.length; i++) {
var o_item = trees[0].a_index[i];
if (!o_item.b_opened) o_item.open(o_item.b_opened);
}
}

function collapse_all () {
for (var i = 1; i < trees[0].a_index.length; i++) {
var o_item = trees[0].a_index[i];
if (o_item.b_opened) o_item.open(o_item.b_opened);
}
}

... then after you call:

new tree (TREE_ITEMS, tree_tpl);

call:

either to open all or close all - NOTE: if you have a large tree this will use a lot fo client resources to open everything or close everything - can cause the browser to 'hang' or go unresponsive for few moments ...
View User's Profile View All Posts By User U2U Member
esm
Member

Posts: 39
Registered: 1/7/2004
Member Is Offline
posted on 2/8/2005 at 03:18 PM Reply With Quote

Thanks, I'll try that.
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