DropDown Field in mvc.ext.net with Model

  1. #1

    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 :

    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.
  2. #2
    awr--shit i forgot:


    .DisplayField("Name")
    Sorry, i hope that helpes someone else too.

Similar Threads

  1. [CLOSED] Form panel for model not displaying dropdown
    By chinninani in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Aug 05, 2013, 12:14 PM
  2. Dropdown Field - Dynamic Drop Window
    By macinator in forum 2.x Help
    Replies: 0
    Last Post: Jun 12, 2013, 9:24 AM
  3. [CLOSED] dropdown field width
    By rnachman in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Oct 02, 2012, 7:28 PM
  4. [CLOSED] Dropdown Field List Position
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 10
    Last Post: Apr 14, 2011, 7:04 PM
  5. [CLOSED] Dropdown Field Icon Error
    By amitpareek in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 13, 2010, 2:19 PM

Tags for this Thread

Posting Permissions