Apr 01, 2014, 7:37 AM
DropDown Field in mvc.ext.net with Model
Hi guys,
i am trying to create a Dropdown list / Combo Box in my project. This DropDown should be filled with data of the model, but it just stays blank :
I add in this method the departments to the List<object> as the following:
Regards.
i am trying to create a Dropdown list / Combo Box in my project. This DropDown should be filled with data of the model, but it just stays blank :
X.ComboBox()
.ID("department")
.FieldLabel("Department")
.Editable(false)
.QueryMode(DataLoadMode.Local)
.EmptyText("Select a superior")
.TriggerAction(TriggerAction.All)
.Store(Html.X().Store()
.AutoLoad(true)
.Model(Html.X().Model()
.IDProperty("Id")
.Fields(
new ModelField("Id", ModelFieldType.String) ,
new ModelField("Name", ModelFieldType.String)
)
)
.DataSource(Model.getDepartments())
)
The method getDepartments() returns a List<object>, i already debugged that one the return value is fine.I add in this method the departments to the List<object> as the following:
departments.Add(new { Id = department_id, Name = departmend_leader });
Hope you can provide me help, i could not find an example that helped me in your example explorer.Regards.