This question is locked. New answers and comments are not allowed.
Similar to a combobox/dropdown, I'd like to use a TreeView as a "Picker" object. While this isn't my example exactly, it applies well. Imagine that I'm trying to pick major cities in countries. My data might look like this (numbers are IDs but are not displayed, parent nodes are Country entities while child nodes are City entities):
Right now, I understand the TreeView can be used as a picker but it doesn't really have the concept of IDs and TextValues like any normal "Picker" object would. Is there a standard way to get this to work like every other picker object in the world where we can work with IDs but display TextValues without writing a bunch of crappy hacky code?
In my current scenario, I'd LIKE for the groups to be bound via AJAX and to use jquery to put the "SelectedID" into a HiddenFor, which is bound to Model.SelectedCityID. All of this works great now, except, there is no concept of IDs as far as I can tell. Is there a way to easily add this concept to the TreeView? And if not, can we PLEASE PLEASE PLEASE get this added soon? Having a "Picker" that doesn't understand the concept of an ID makes the picker VERY difficult to use and requires us to waste time writing hacky code that we shouldn't have to write.
Thanks!
-Shane
- USA [1] (EXPANDED)
|___ Chicago [1]
|___ New York City [2] (SELECTED)
|___ Seattle [3]
|___ Paris [4]
+ France [2] (COLLAPSED)
|___ Paris [5] (HIDDEN)
|___ Marseille [6] (HIDDEN)
Right now, I understand the TreeView can be used as a picker but it doesn't really have the concept of IDs and TextValues like any normal "Picker" object would. Is there a standard way to get this to work like every other picker object in the world where we can work with IDs but display TextValues without writing a bunch of crappy hacky code?
In my current scenario, I'd LIKE for the groups to be bound via AJAX and to use jquery to put the "SelectedID" into a HiddenFor, which is bound to Model.SelectedCityID. All of this works great now, except, there is no concept of IDs as far as I can tell. Is there a way to easily add this concept to the TreeView? And if not, can we PLEASE PLEASE PLEASE get this added soon? Having a "Picker" that doesn't understand the concept of an ID makes the picker VERY difficult to use and requires us to waste time writing hacky code that we shouldn't have to write.
Thanks!
-Shane