views:

39

answers:

1

Ok, I'll probably be down-voted on this question but my heads not working and I can't come up with a neat solution.

Basically, I need to hold a series of dropdownlists in a database or xml file which will eventually be displayed and used on a page. Problem is I also need them to cascade and hold state after a form submission in MVC. Has anyone come across an example of this type of thing?

+1  A: 

by cascading do you mean hierarchical+autofiltering?

maybe this is the data structure you need: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html

autofiltering and "hold state" depends on the programming language.

voro
Yes I do, I need to be able to create separate dropdowns but connect them neatly in a parent/child structure. The project is in MVC which doesnt hold state and that complicates things as if ddl2 is populated based on the selection from ddl1 using say jquery, I now need to filter the FormCollection to set ddl2's list again and set the correct item to selected in ddl2 on form submission (which just reloadsd the page and data on it dependent on the formcollection). Its all a bit messy
Israfel
the the data structure I suggested fits your needs.for the autopopulating of ddl2, just use ajax to query an action in one of the controllers which in turn queries that mptt table for the children of ddl1[element]
voro