This is a migrated thread and some comments may be shown as answers.

[Solved] Hierarchical On-Demand Binding

1 Answer 47 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dannie F
Top achievements
Rank 1
Dannie F asked on 23 Apr 2010, 08:21 PM
Hi I'm evaluation TreeView for use in a project I'm working on. The data looks like this:

Region 1
    -- State 1
         -- City 1
         -- City 2
-- State 2
Region 2
-- State 3
-- State 4

I would like to bind the regions on the server then bind the states on-demand. When a state is clicked, I'd like to bind the cities on-demand.

I see in the examples where this can be done but my problem, the ajax call is done to one controller method and a TreeViewModel is passed but I  don't see a way of knowing if I should be loading State data or City data.

Is this possible? If not, how can I work around it?

Thanks

1 Answer, 1 is accepted

Sort by
0
Dannie F
Top achievements
Rank 1
answered on 24 Apr 2010, 12:48 AM
I actually worked around this problem by supplying a composite value to the tree node like "state:{id}" and "region:{id}".
Tags
TreeView
Asked by
Dannie F
Top achievements
Rank 1
Answers by
Dannie F
Top achievements
Rank 1
Share this question
or