$('#customerList').ejDropDownList({
dataSource: customerList ,
fields : { text: "ContactName", value: 'ContactName' },
itemsCount : 20 ,
popupHeight: "200px",
width: "250px",
enableFilterSearch: true,
enableServerFiltering: true,
allowVirtualScrolling: true,
search: function(args) {
if (args.searchString.length < 3 ) { //check search string length
args.cancel = true;
}
} |
<div class="control">
<div class="ctrllabel">Select a Customer Name</div>
<input type="text" id="customerList" />
</div>
<script type="text/javascript">
var customerList = ej.DataManager({
crossDomain: true
});
var query = ej.Query().select("ShipName", "ShipCountry").where("ShipCountry", "equal", "France", false);
$(function () {
$('#customerList').ejDropDownList({
dataSource: customerList ,
query: query,
fields: { text: "ShipName", value: "ShipCountry" },
itemsCount : 20 ,
popupHeight: "200px",
width: "250px",
enableFilterSearch: true,
enableServerFiltering: true,
allowVirtualScrolling: true,
search: function(args) {
if (args.searchString.length < 3 ) { //check search string length
args.cancel = true;
}
}
});
});
</script>
|