Migration from Essential JS 1
21 Feb 202210 minutes to read
This article describes the API migration process of ComboBox component from Essential JS 1 to Essential JS 2.
DataBinding
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Default |
Property: DatasourceHtml.EJ().ComboBox("select").Datasource((IEnumerable<CarsList>)ViewBag.datasource).Render()
|
Property: DataSource@Html.EJS().ComboBox("games").DataSource((IEnumerable<object>)ViewBag.localdata).Render()
|
Fields for mapping |
Property: ComboBoxFieldsHtml.EJ().ComboBox("select").ComboBoxFields(f=>f.Text("text")).Render()
|
Property: Fields@Html.EJS().ComboBox("games").Fields(new ComboBoxFieldSettings { Text = "Game", Value = "Id" }).Render()
|
Query |
Property: QueryHtml.EJ().ComboBox("select").Query("ej.Query().from('Suppliers').select('SupplierID', 'ContactName')").Render()
|
Property: Query@Html.EJS().ComboBox("games").Query((string)ViewBag.query).Render()
|
Begin event |
Event:ActionBeginHtml.EJ().ComboBox("select").ActionBegin("onBegin").Render()
|
Event: ActionBeginHtml.EJ().ComboBox("select").ActionBegin("onBegin").Render()
|
Complete event |
Event:ActionCompleteHtml.EJS().ComboBox("select").ActionComplete("onComplete").Render()
|
Event: ActionCompleteHtml.EJS().ComboBox("select").ActionComplete("onComplete").Render()
|
Failure event |
Event:ActionFailureHtml.EJ().ComboBox("select").ActionFailure("onFailure").Render()
|
Event: ActionFailureHtml.EJS().ComboBox("select").ActionFailure("onFailure").Render()
|
Filtering
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Default |
Property: AllowFilteringHtml.EJ().ComboBox("select").AllowFiltering(true).Render()
|
Property: AllowFilteringHtml.EJS().ComboBox("select").AllowFiltering(true).Render()
|
No records template |
Property: NoRecordsTemplateHtml.EJ().ComboBox("select").NoRecordsTemplate("<span class='norecord'> NO DATA AVAILABLE</span>").Render()
|
Property: NoRecordsTemplateHtml.EJS().ComboBox("select").NoRecordsTemplate("<span class='norecord'> NO DATA AVAILABLE</span>").Render()
|
Ignore casing and diacritics | Not Applicable |
Property: IgnoreAccentHtml.EJS().ComboBox("select").AllowFiltering(true).Render()
|
Custom value addition |
Property: AllowCustomHtml.EJ().ComboBox("select").AllowCustom(true).Render()
|
https://ej2.syncfusion.com/aspnetmvc/ComboBox/CustomValue#/material |
Search event |
Event: FilteringHtml.EJ().ComboBox("select").Filtering("Filtering").Render()
|
Event: FilteringHtml.EJS().ComboBox("select").Filtering("Filtering").Render()
|
Template
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Default |
Property: ItemTemplateHtml.EJ().ComboBox("select").ItemTemplate("<div><img class='eimg' src='../images/combobox/${eimg}.png' alt='employee'/><div class='ename'> ${text} </div><div class='temp'> ${country} </div></div>").Render()
|
Property: ItemTemplateHtml.EJS().ComboBox("select").ItemTemplate("<div><img class='eimg' src='../images/combobox/${eimg}.png' alt='employee'/><div class='ename'> ${text} </div><div class='temp'> ${country} </div></div>").Render()
|
Group Template |
Property: GroupTemplateHtml.EJ().ComboBox("select").GroupTemplate("<strong>${country}</strong>").Render()
|
Property: GroupTemplateHtml.EJS().ComboBox("select").GroupTemplate("<strong>${country}</strong>").Render()
|
ValueTemplate | Not Applicable |
Property: ValueTemplateHtml.EJS().ComboBox("select").ValueTemplate("<span class='norecord'> NO DATA AVAILABLE</span>").Render()
|
Header Template |
Property: HeaderTemplateHtml.EJ().ComboBox("select").HeaderTemplate("<div class='head'> Photo <span style='padding-left:42px'> Contact Info </span></div>").Render()
|
Property: HeaderTemplateHtml.EJS().ComboBox("select").HeaderTemplate("<div class='head'> Photo <span style='padding-left:42px'> Contact Info </span></div>").Render()
|
FooterTemplate |
Property: FooterTemplateHtml.EJ().ComboBox("select").FooterTemplate("<div class='Foot'> Total Items Count: 5 </div>").Render()
|
Property: FooterTemplateHtml.EJS().ComboBox("select").FooterTemplate("<div class='Foot'> Total Items Count: 5 </div>").Render()
|
No records Template |
Property: NoRecordsTemplateHtml.EJ().ComboBox("select").NoRecordsTemplate("<span class='norecord'> NO DATA AVAILABLE</span>").Render()
|
Property: NoRecordsTemplateHtml.EJS().ComboBox("select").NoRecordsTemplate("<span class='norecord'> NO DATA AVAILABLE</span>").Render()
|
Auto fill |
Property: AutoFillHtml.EJ().ComboBox("select").AutoFill(true).Render()
|
Property: AutoFillHtml.EJS().ComboBox("select").AutoFill(true).Render()
|
Action failure Template |
Property: ActionFailureTemplateHtml.EJ().ComboBox("select").ActionFailureTemplate("<span class='action-failure'>Data fetch get fails</span>").Render()
|
Property: ActionFailureTemplateHtml.EJS().ComboBox("select").ActionFailureTemplate("<span class='action-failure'>Data fetch get fails</span>").Render()
|
Applying CSS
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Default |
Property: CssClass Html.EJ().ComboBox("select").CssClass("customclass").Render()
|
Property: CssClassHtml.EJS().ComboBox("select").CssClass("customclass").Render()
|
width |
Property: Width Html.EJ().ComboBox("select").Width("300px").Render()
|
Property: WidthHtml.EJS().ComboBox("select").Width("300px").Render()
|
Grouping
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Default |
Property: ComboBoxFieldsHtml.EJ().ComboBox("select").ComboBoxFields(f=>f.GroupBy("text")).Render()
|
Property: Fields@Html.EJS().ComboBox("games").Fields(new ComboBoxFieldSettings { GroupBy = "Game" }).Render()
|
Accessibility
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Globalizaation |
Property: LocaleHtml.EJ().ComboBox("select").Locale("fr-FE").Render()
|
Property: LocaleHtml.EJS().ComboBox("select").Locale("fr-FE").Render()
|
Rtl support |
Property: EnableRtlHtml.EJ().ComboBox("select").EnableRtl(true).Render()
|
Property: EnableRtlHtml.EJS().ComboBox("select").EnableRtl(true).Render()
|
Placeholder
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Watermark text |
Property: PlaceholderHtml.EJ().ComboBox("select").Placeholder("Select").Render()
|
Property: Placeholder Html.EJS().ComboBox("select").Placeholder("Select").Render()
|
Floating of waterMarkText | Not applicable |
Property: FloatLabelTypeHtml.EJS().ComboBox("select").FloatLabelType(FloatLabelType .Auto).Render()
|
Miscellaneous
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Enable/disable |
Property: EnabledHtml.EJ().ComboBox("select").Enabled(true).Render()
|
Property: EnabledHtml.EJS().ComboBox("select").Enabled(true).Render()
|
Read only |
Property: ReadOnlyHtml.EJ().ComboBox("select").ReadOnly(true).Render()
|
Property: ReadOnlyHtml.EJS().ComboBox("select").ReadOnly(true).Render()
|
Addition of Html attributes |
Property: HtmlAttributesHtml.EJ().ComboBox("select").HtmlAttributes(ViewBag.attr).Render()
|
Property: HtmlAttributesHtml.EJS().ComboBox("select").HtmlAttributes(ViewBag.attr).Render()
|
Sorting
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Order of sorting |
Property: SortOrderHtml.EJ().ComboBox("select").SortOrder(SortOrder.Ascending).Render()
|
Property: SortOrderHtml.EJS().ComboBox("select").SortOrder(SortOrder.Ascending).Render()
|
Selection
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Selecting particular index |
Property: IndexHtml.EJ().ComboBox("select").Index(1).Render()
|
Property: IndexHtml.EJS().ComboBox("select").Index(1).Render()
|
Selecting particular value |
Property: ValueHtml.EJ().ComboBox("select").Value("Car").Render()
|
Property: ValueHtml.EJS().ComboBox("select").Value("Car").Render()
|
Selecting particular text |
Property: Text Html.EJ().ComboBox("select").Text("Car").Render()
|
Property: TextHtml.EJ()S.ComboBox("select").Text("Car").Render()
|
Getting data by using value |
Method: getItemDataByValueHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejDropDownList(‘getItemDataByValue’,”data”) |
Method: getDataByValueHtml.EJ().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.getDataByValue(“data”); |
Select event |
Event: SelectHtml.EJ().ComboBox("dropdown").Select("onSelect").Render()
|
Event: SelectHtml.EJS().ComboBox("dropdown").Select("onSelect").Render()
|
Popup
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Popup height |
Property: PopupHeightHtml.EJ().ComboBox("dropdown").PopupHeight("300px").Render()
|
Event:PopupheightHtml.EJS().ComboBox("dropdown").PopupHeight("300px").Render()
|
Popup width |
Property: PopupWidthHtml.EJ().ComboBox("dropdown").PopupWidth("300px").Render()
|
Event:PopupWidthHtml.EJS().ComboBox("dropdown").PopupWidth("300px").Render()
|
Popup showing manually |
Method: showPopupHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“showPopup”); |
Method: showPopupHtml.EJS().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.showPopup(); |
Popup hiding manually |
Method: hidePopupHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“hidePopup”); |
Method: hidePopupHtml.EJS().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.hidePopup(); |
Popup hide event |
Event: CloseHtml.EJ().ComboBox("dropdown").Close("onClose").Render()
|
Event: CloseHtml.EJS().ComboBox("dropdown").Close("onClose").Render()
|
Popup shown event |
Event: OpenHtml.EJ().ComboBox("dropdown").Open("onOpen").Render()
|
Event: OpenHtml.EJS().ComboBox("dropdown").Open("onOpen").Render()
|
Common
Behavior | API in Essential JS 1 | API in Essential JS 2 |
---|---|---|
Adding new item |
Method : addItemHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“addItem”, { text :”India”}); |
Method: addItemHtml.EJ().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.addItem({Id: ‘id’, Game: ‘Golf’},2); |
Focus out event | Not applicable |
Event: BlurHtml.EJS().ComboBox("dropdown").Blur("onBlur").Render()
|
Focus in event |
Event: FocusHtml.EJ().ComboBox("dropdown").Focus("onFocus").Render()
|
Event: FocusInHtml.EJS().ComboBox("dropdown").Focus("onFocus").Render()
|
Focus out |
Method: focusOutHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“focusOut”); |
Method: focusOutHtml.EJS().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.focusOut(); |
Focus in |
Method: focusInHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“focusIn”); |
Method: focusInHtml.EJS().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.focusIn(); |
Getting the data |
Method : getItemsHtml.EJ().ComboBox("dropdown").Render() $(‘#dropdown’).ejComboBox(“getItems”); |
Method: getItemsHtml.EJS().ComboBox("combobox").Render() var cmbObj = document.getElementById(combobox).ej2_Instances[0]; cmbObj.getItems(); |
Create event |
Event: CreateHtml.EJ().ComboBox("dropdown").Create("onCreate").Render()
|
Event: CreatedHtml.EJS().ComboBox("dropdown").Created("onCreate").Render()
|
Change event |
Event: ChangeHtml.EJ().ComboBox("dropdown").Change("onChange").Render()
|
Event: ChangeHtml.EJS().ComboBox("dropdown").Change("onChange").Render()
|
Custom value event |
Event: custom-value-specifierHtml.EJ().ComboBox("dropdown").CustomValueSpecifier("fucntion").Render()
|
Event: CustomValueSpecifierHtml.EJS().ComboBox("dropdown").CustomValueSpecifier("fucntion").Render()
|