tags:

views:

83

answers:

1

I know how to render a unordered list with children when returning data from the database but I have a slightly different requirement.

My view has a top level of list items in the UL made up of dates. When the user clicks a date it needs to send that server side to run a query to render the possible children. It has to do this up to 4 levels deep.

My question is once you send the parameter server side how do you make sure that the previous nodes are in tact because by the time you are 4 levels deep you have lost the model that generated the top level.

A: 

I'm not sure that I understood the question. In order to check the state of the model you have to parametrize those states. For example level 1 contains item with certain id's, level 2 other ids. During the ajax requests the model state is send to server so it can render appropriate control.

Jenea
You recommend using AJAX to do it? Do you have an example?
Jon
Now I don't recoment to use AJAX. Actually it doesn't matter if it is ajax or not. The main point is that you need to send the whole state in order to be able to check the model.
Jenea
So when you get to level 4 you have to run the query for the top, second and third level?
Jon
Yes. Well it depends on your model parametrization.
Jenea
Well each level runs a completely seperate query so unfortunately it can't be parametized
Jon