1

I'm trying to put a nested list on a page into a div element, and it works fine, until I click some of the items, having descendant elements — in this case nested list redraws the whole page to display the children.

All the examples I found, display the same behavior. For example, jQuery Mobile Demos page: http://demos.jquerymobile.com/1.4.5/listview-nested-lists/

Is there any way to display and navigate a nested set element without replacing the page?

2
  • You could use collapsibles to expand the nodes that have children. Commented Dec 4, 2014 at 14:31
  • Yes, I know. But the task is to use the nested listview only. I could, probably, make the same behavior using only lists and transitions, but it will take much time. I hope, someone has a workaround to make nested listview open its children within a container. Commented Dec 4, 2014 at 14:37

1 Answer 1

1

I'm not sure what exactly you are trying to achieve but you could slide them Up and click to slide them Down using (next)

$(".hide").next().slideUp('fast');
$(".hide").click(function(e) {
$(this).next().slideToggle('fast');
})

Demo

http://jsfiddle.net/2u020dqa/

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you, but this solution doesn't fit my needs. It looks like an 'accordion', but I need something, what looks like the example on the link in my question (a list with arrows on the right if has children) and when you tap/click it, it slides to the left, and the descendant menu reveals from the right side.
Yes, this solution is much closer to what I'm looking for. I need to navigate a tree this way: chose one node from a list and click it, then see the next list of nodes. If some of the nodes have children, display an arrow to make it possible to go deeper.
thats no problem. when you click on an item, clone the whole list, and append a new one with data. when you go back append the clone list. Basic Demo. try "Infiniti, G37" jsfiddle.net/z5sa9z5g

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.