|
<div class='control-wrapper'>
<div style='padding-top:75px;'>
<ejs-combobox id="customers" query="new ej.data.Query().from('Employees').select(['FirstName', 'City', 'EmployeeID']).take(6).where(new ej.data.Predicate('City', 'equal','london').or('City','equal','seattle'))" placeholder="Select a customer" popupHeight="200px"
groupTemplate="@Html.Raw("<button class='e-btn'>${City}</button>")">
<e-combobox-fields groupBy="City" value="FirstName"></e-combobox-fields>
<e-data-manager url="https://services.odata.org/V4/Northwind/Northwind.svc/" adaptor="ODataV4Adaptor" crossDomain="true"></e-data-manager>
</ejs-combobox>
</div>
</div> |
|
[index.cshtml]
<div class='control-wrapper'>
<div style='padding-top:75px;'>
<ejs-combobox id="customers" created="OnCreate" query="new ej.data.Query().from('Employees').select(['FirstName', 'City', 'EmployeeID']).take(6).where(new ej.data.Predicate('City', 'equal','london').or('City','equal','seattle'))" placeholder="Select a customer" popupHeight="200px"
groupTemplate="@Html.Raw("<button class='e-btn'>${City}</button>")">
<e-combobox-fields groupBy="City" value="FirstName"></e-combobox-fields>
<e-data-manager url="https://services.odata.org/V4/Northwind/Northwind.svc/" adaptor="ODataV4Adaptor" crossDomain="true"></e-data-manager>
</ejs-combobox>
</div>
</div>
<script>
function OnCreate(args) {
// Create the span element for insert phone icon
var span = document.createElement("span");
// Add the phone icon class to the span element
span.setAttribute("class", "fa fa-phone");
// append the span element after the input wrapper
this.inputWrapper.container.insertAdjacentElement('afterbegin', span);
}
</script>
<style>
span.fa.fa-phone {
position: absolute;
border: 0.5px solid #ced4da;
align-items: center;
justify-content: center;
line-height: 2;
min-width: 28px;
height: 30px;
text-align: center;
background-color: #e4e5e6;
border-radius: 4px 0 0 4px;
font-size: 14px;
margin-left: 0px;
margin-top: 0px;
}
.e-input.e-combobox {
text-indent: 27px !important;
}
</style> |
|
[_Layout.cshtml]
<link rel="stylesheet" rel='nofollow' href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> |