[OPEN] [#1622] [4.7.1] assign Store to MultiSelectorSearch of MultiSelector

Page 2 of 2 FirstFirst 12
  1. #11
    Hello Fabrício
    it Worked perfectly.
    You're Great.
    thank you so much
  2. #12
    Hello Fabrício
    I apologize for the length of the Thread before anything.but it is Last question.
    As usual Mvc Grab the fields in View.for simple components like TextField and combo i used from "Value" atribute or ControlFor like What is mentioned below.
       X.TextField().ID("NumOfStudent").FieldLabel("students").Value(Model.NumOfStudent).Cls("SetFont")
    or
     X.ComboBox().RTL(true)
    
                 .ID("ComboBoxPerson")
                  .TypeAhead(true)
                 .QueryMode(DataLoadMode.Local)
                 .ForceSelection(true)
                 .TriggerAction(TriggerAction.All)
                 .DisplayField("Text")
                 .ValueField("Value")
                 .Cls("combo-rtl")
                 .BaseCls("combo-rtl")
                 .EmptyValue(0)
                 .ControlFor("Title")   
                 .Items((IEnumerable<Ext.Net.ListItem>)ViewBag.Data)
    My last question is that how Can i add multiselector Value to Model
    I examined following codes but the model was not filled
      Html.X().MultiSelector()
                                                  .Width(400)
                                                  .Height(120)
                                                  .FieldName("Title")
                                                  .MultiSelect(true)
                                                  .AutoScroll(true)
                                                  .ControlFor("Units")
                                                  .Scrollable(ScrollableOption.Both)
                                                  .AllowDeselect(true)
                                                  .Selectable(true)
                                                  .Store(
                                                      Html.X().Store().ID("UnitStore")
                                                          .DataSource(Model.PartUnits)
                                                          .Model(
                                                              Html.X().Model()
                                                                  .Fields(
                                                                      new ModelField("Title", ModelFieldType.String),
                                                                      new ModelField("Id", ModelFieldType.Int)
                                                                  )
                                                          )
                                                  )
                                                  .Search((searchcomp) =>
                                                  {
                                                      searchcomp.Add(
                                                          Html.X().MultiSelectorSearch() 
                                                              .SearchGridConfig(Html.X().GridPanel().BufferedRenderer(false))
                                                              .Store((store) =>
                                                              {
                                                                  store.Add(
                                                                      Html.X().Store()
                                                                          .ID("UnitStores")
                                                                          .DataSource(Model.Units)
                                                                          .Model(
                                                                              Html.X().Model()
                                                                                  .Fields(
                                                                                      new ModelField("Title", ModelFieldType.String)
                                                                                  )
                                                                          )
                                                                      );
                                                              })
                                                          );
                                                  })
    and model
     public class EdPersonCreateVm : BaseEntityVm, IHaveCustomMappings
        {
            public IEnumerable<EdUnit> Units { get; set; } = null;
            public IEnumerable<EdUnit> PartUnits { get; set; } = null;
            public List<SelectListItem> roleList { get; set; }
            public ICollection<EdClass> Classes { get; set; }
            public IEnumerable<EdFeedBackBox> FeedBacks { get; set; }
            public ICollection<EdLesson> Lessons { get; set; }
    
            public IEnumerable<object> Unt { get; set; } = null;
    .
    .
    .
    }
    It also did not work
     .ControlFor("Unt")
    i need list of UnitId's that is displayed in the multiselector but this component has not ValueField for Setting" UnitId".I need this for use in controller but viewPage does not Grab Value of Multiselector.
    if i can attach value of Multiselector(array or list of Id's) to Model my problem is Solved.
    Thank you very much for help
    Last edited by orpheus; Yesterday at 12:10 PM.
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Multiselector Clear and DataBind.
    By oespiao in forum 4.x Help
    Replies: 1
    Last Post: Mar 01, 2017, 1:20 PM
  2. How to assign store.
    By massman07 in forum 2.x Help
    Replies: 7
    Last Post: Jul 15, 2014, 12:10 PM
  3. Replies: 8
    Last Post: Dec 18, 2013, 2:59 AM
  4. Replies: 1
    Last Post: Jun 18, 2013, 4:56 PM
  5. [CLOSED] assign collection to store on the client
    By LeeTheGreek in forum 1.x Premium Help
    Replies: 1
    Last Post: May 23, 2010, 7:46 PM

Posting Permissions