I've been having trouble with the persist:cookies generally and was
pleased to see your edited post regarding 1.4.1.
However, I'm now using lazy loading with the treeview.async.js  model
and find that that the treeview.js 1.4.1 appears to break completely.

Should I expect the  persist:cookies option to work with
treeview.async.js?

I had intended to manage the persistence server side using the toggle
call back.  However, this also has it's problems currently and am
looking for the "path of least new code" to achieve a correctly
function and persistent tree with unique branch display and aysnc
loading.

Anyone having success with this?

On Jul 17, 4:06 am, "Matt B." <mbrown...@gmail.com> wrote:
> Edit: I realized that "cookieOptions" is actually a version 1.4.1
> feature, only available from the SVN. The feature hasnotyet been
> added to the minified version, so you need to grab the uncompressed
> version here:
>
> http://dev.jquery.com/browser/trunk/plugins/treeview/jquery.treeview.js
>
> So it'snotundocumented, it's just that 1.4.1 hasn't officially been
> released yet.
>
> On Jul 16, 8:45 am, "Matt B." <mbrown...@gmail.com> wrote:
>
>
>
> > I just thought I'd post a solution I came up with that may be helpful
> > to anyone using thetreeviewplugin fornavigation.
>
> > The problem I ran into was that thecookiepersistence wasworking,
> > but since I was using the tree fornavigationto different directories
> > of my site, sometimes thecookiewouldn't get set correctly and the
> > state of the tree would end up being one step behind what the user had
> > just clicked -- so the previously clicked node would be expanded
> > rather than the current one.
>
> > Thanks to some helpful posts I found on here, I discovered that the
> > problem was thecookiepath.
>
> > The solution is to use an (undocumented) option that was added to the
> > plugin as of version 1.4: 'cookieOptions', which lets you set the
> >cookiepath.
>
> > If yournavigationtree could potentially be used for any page in your
> > domain, then you would set thecookiepath to the root, like this:
>
> > cookieOptions: {path: '/'}
>
> > ..or if your site is in a subdirectory you should use this:
> > cookieOptions: {path: '/my_subdirectory/'}
>
> > In my case I'm using PHP and I have my site root stored in a constant
> > called WEB_ROOT, so my full code was:
>
> >         $(document).ready(function() {
> >                 $("#sideNav ul").treeview({
> >                         collapsed: true,
> >                         unique: true,
> >                        persist: "cookie",
> >                         cookieOptions: {path: '<?= WEB_ROOT ?>'}
> >                 });
> >         });
>
> > Hope this is helpful to somebody.

Reply via email to