Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Is it possible to limit how deep the tree can go?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
vakata  
View profile  
 More options Apr 9 2009, 1:46 pm
From: vakata <ivan.bozha...@gmail.com>
Date: Thu, 9 Apr 2009 10:46:52 -0700 (PDT)
Local: Thurs, Apr 9 2009 1:46 pm
Subject: Re: Is it possible to limit how deep the tree can go?
Hi,
I am sorry the metadata example was not available when I posted my
previous reply - you can take a look at it now:
http://www.jstree.com/reference/_examples/5_others.html (the second
example).

Basically you need this type of structure:
...
        {
                attributes: {id: 1, mdata : "{ type: 'file',
max_depth : 2 }" },
                state: 'closed',
                data: 'Electronics'
        },
...

mdata becomes part of the attributes and its value is a string.

I hope this helps!
Best regards,
Ivan

On 9 Апр, 10:44, boteeka <bote...@gmail.com> wrote:

> Ok, that was dumb on my part not to look first. Sorry.

> However, I looked on the examples. The difference is that I'm using
> async JSON as source, and it doesn't seem to work. Here it is the JSON
> response for the top level objects:
> ([
>         {
>                 attributes: {id: 1},
>                 state: 'closed',
>                 data: 'Electronics',
>                 mdata: { type: 'file', max_depth : 2 }
>         },
>         {
>                 attributes: {id: 6},
>                 state: 'closed',
>                 data: 'Portable electronics',
>                 mdata: { type: 'folder', max_depth : 2 }
>         }
> ])

> In the rules attribute of the configuration I set metadata: "mdata".
> Oh, and the metadata jquery plugin is loaded.

> The problem is that it doesn't work at all. Even if I change the type
> to file it doesn't show any difference.
> Most probably I made some mistakes on the metadata part, but can't
> figure it out what exactly.

> On Apr 8, 6:16 pm, vakata <ivan.bozha...@gmail.com> wrote:

> > Yes, check the metadata (under "others" on the examples page) examples
> > - what you are looking for is "max_depth".

> > Best regards,
> > Ivan

> > On 8 Апр, 17:02, boteeka <bote...@gmail.com> wrote:

> > > I have a tree with folder nodes only on it. These nodes can be dragged
> > > and dropped on each other. I want to limit the tree to be only two
> > > levels deep, and so any drag-and-drop attempts which would make the
> > > tree more deep would be disallowed. Is there a method to accomplish
> > > this with the current featureset of jsTree 0.9.6?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.