This discussion is archived
1 Reply Latest reply: Jul 17, 2013 8:13 PM by jrimblas RSS

Hierarchical list question

DaveWill Newbie
Currently Being Moderated

I have a hierarchical list (not tree list) defined under applications shared components.  The idea is to use this for navigation.

 

Defined a zero page that has left and right panes.  In the left pane the list is used for navigation.

 

How do I preserve the expanded list between different page loads?

 

Currently when I expand and choose an item from the hierarchical list a certain page loads.  But the loaded page has the hierarchical list collapsed.  Once the list is expanded, How can I preserve the state between page loads?

  • 1. Re: Hierarchical list question
    jrimblas Expert
    Currently Being Moderated

    The exact solution depends on the specific theme and template used.

    But, here is one javascript general idea solution.

    Your list probably opens with some class (this is where knowing the exact template is key). Lets say it adds the class "open" when you click on something to expand.

    Then lets assume that the current element, the one selected gets a "selected" class added.

    If this where the case, then you could find the selected element.

    $("#nav-list").find(".selected");

    Then you want to "roll-up" to the parent and add the class of open.

    $("#nav-list").find(".selected").closest(".main").addClass("open");

    Again, the assumption here is that all the main/parent elements have a class of "main"

    You would do this on every page load.

     

    Another approach is to just render your list with a PL/SQL Region, and do something similar as above, but that sounds like a lot of work. 

     

    Thanks

    -Jorge

    http://rimblas.com/blog/

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points