ejs-for

I see there is ejs-for option for DatePicker and DateTimePicker control to show value from the model in the view. 
Is there some plans to do that with numerictextbox, dropdown, autocomplete, checkbox...like in MVC controls?

Thanks.
Bernard.

5 Replies

SK Shanmugaraja K Syncfusion Team September 17, 2018 07:20 AM UTC

Hi Bernard, 
 
Thank your using Syncfusion products. 
 
We have already provided ejs-for support for NumericTexBox, AutoComplete, Dropdown, and Checkbox. Please find the below code example for this support. 
 
[CSHTML
 
 
        <h4>Numeric text box</h4> 
        <ejs-numerictextbox width="150px" id="TextValue"  min="0" showSpinButton="false" decimals="2" validateDecimalOnType="true" value="@Model.TextValue" ejs-for="@Model.TextValue"></ejs-numerictextbox><br /> 
 
        <h4>Checkbox</h4> 
        <ejs-checkbox id="chk1" ejs-for="@Model.value" value="@Model.value"></ejs-checkbox><br /> 
 
        <h4>DropDown</h4> 
        <ejs-dropdownlist id="games" ejs-for="@Model.games" dataSource="@ViewBag.dropData" placeholder="Select a game" index="2" popupHeight="220px" width="200px" > 
            <e-dropdownlist-fields text="Game" value="Id"></e-dropdownlist-fields> 
        </ejs-dropdownlist> 
 
        <h4>Autocomplete</h4> 
        <ejs-autocomplete id="auto" ejs-for="@Model.auto" dataSource="@ViewBag.autoData" placeholder="e.g. Basketball" width="200px" > 
        </ejs-autocomplete><br /> 
 
[CS
 
 
        public IActionResult Index() 
        { 
            InputValues obj = new InputValues(); 
            obj.value = true; 
            obj.TextValue = 24; 
            ViewBag.dropData = new GameList().GameLists(); 
            ViewBag.autoData = new string[] { "American Football", "Badminton", "Basketball", "Cricket", "Football", "Golf", "Hockey", "Rugby", "Snooker", "Tennis" }; 
            return View(obj); 
        } 
 
 
We have prepared simple sample based on your query and attached in the below location. 
 
 
Please try the above sample and check whether this fulfilling your requirement. And please let us know if you need any other information regarding this. 
 
Regards, 
Shanmugaraja K  
 



BJ Bernard Jurlina September 17, 2018 06:58 PM UTC

Excellent,

thank you Shanmugaraja.

Regards,
Bernard.


SK Shanmugaraja K Syncfusion Team September 18, 2018 07:22 AM UTC

Hi Bernard, 
 
Most welcome, please let us know if you need any assistance. 
 
Regards, 
Shanmugaraja K 



PA Patryk March 15, 2019 10:25 AM UTC

Hi!
I can not find information about "ejs-for" for "ejs-combobox".
I need to write to the property string the value selected by the user in the combobox.
There is a possibility?
If not, how to do it alternatively?


DL Deepa Loganathan Syncfusion Team March 18, 2019 10:18 AM UTC

Hi Bernard,  
 
 
Yes, we have provided strongly typed Combo box for binding model values. We have documented the usage of strongly typed Combobox in the below help page.  
 
 
 
 
Please check and get back to us if you have any further queries. 
 
 
Regards,  
 
Deepa L.  


Loader.
Up arrow icon