thanks for your answer but I dont get it, I was thinking about to write a 
parameter with Session->write to read it beforeRender and fill my view 
depending on that parameter.

Is there a way to have that functionality just with Js?



On Tuesday, September 4, 2012 2:27:19 PM UTC-6, cricket wrote:
>
> Rather than store the state between requests, you could use some js to 
> open it if necessary. 
>
> $('#mws-navigation a').each(function() 
> { 
>         if ($(this).attr('href') == location.href) 
>         { 
>                 $(this).closest('ul').toggleClass('closed'); 
>                 return false; 
>         } 
> }); 
>
> On Tue, Sep 4, 2012 at 3:11 PM, darkangel <[email protected]<javascript:>> 
> wrote: 
> > Hi, I'm almost finishing my first cake app so I'm fixing some UI issues. 
> > Straight to the point: I have a sidebar menu with a dropdown submenu, 
> the 
> > folding state is defined by the css class "closed" so my question is how 
> can 
> > I save that status to persist between views? Now when I navigate to 
> another 
> > view the class resets to closed. 
> > 
> > this is my View (rendered from my sidebar element): 
> > 
> > <div id="mws-sidebar"> 
> >         <div id="mws-navigation"> 
> >             <ul> 
> >                 <li><?php echo $this->Html->link('Clients', '/clients', 
> > array('class' => 'mws-i-24 i-group'))?></li> 
> >                 <li><?php echo $this->Html->link('Transfers', 
> '/transfers', 
> > array('class' => 'mws-i-24 i-power'))?></li> 
> >                 <li><?php echo $this->Html->link('Hits', '/hits', 
> > array('class' => 'mws-i-24 i-alarm-bell-2'))?></li> 
> >                 <li> 
> >                     <?php echo $this->Html->link('Admin', '#', 
> array('class' 
> > => 'mws-i-24 i-cog')); ?> 
> >                     <ul class="closed"> 
> >                         <li><?php echo $this->Html->link('Users', 
> > '/allUsers'); ?></li> 
> >                         <li><?php echo $this->Html->link('Groups', 
> > '/allGroups'); ?></li> 
> >                         <li><?php echo $this->Html->link('Permissions', 
> > '/permissions'); ?></li> 
> >                     </ul> 
> >                 </li> 
> >             </ul> 
> >         </div> 
> >     </div> 
> > 
> > 
> > This is the Js that toggles the submenu when the user click on the 
> parent 
> > <li> tag: 
> > 
> > $("div#mws-navigation ul li a, div#mws-navigation ul li span") 
> > .bind('click', function(event) { 
> > if($(this).next('ul').size() !== 0) { 
> > $(this).next('ul').slideToggle('fast', function() { 
> > $(this).toggleClass('closed'); 
> > }); 
> > event.preventDefault(); 
> > } 
> > }); 
> > 
> > 
> > Thanks for your help, I really appreciate it in advance. 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "CakePHP" group. 
> > To post to this group, send email to [email protected]<javascript:>. 
>
> > To unsubscribe from this group, send email to 
> > [email protected] <javascript:>. 
> > Visit this group at http://groups.google.com/group/cake-php?hl=en-US. 
> > 
> > 
>

-- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.


Reply via email to