Hi David,
Greetings from Syncfusion support.
Yes, you can achieve the requested requirement by manual validation within the filter event handler. We have documented this information in the below link. Here the remote request does not fetch the filtered datasouce until the search key contains three characters, instead until 3 letters returned the entire datasource as like below. If you would like to return empty list, return the below if condition to meet your requirement.
|
<div style='padding-top:75px;'>
<ejs-multiselect id="customers" placeholder="Select a customer" popupHeight="200px" allowFiltering="true" filtering="onfiltering" query="new ej.data.Query().from('Customers').select(['ContactName', 'CustomerID']).take(6)">
<e-multiselect-fields value="CustomerID" text="ContactName"></e-multiselect-fields>
</ejs-multiselect>
</div>
<script>
function onfiltering(e) {
var CBObj = document.getElementById("customers").ej2_instances[0];
// load overall data when search key empty.
if (e.text == '' && e.text.length < 3) {
e.updateData(CBObj.dataSource);
}
let query = new ej.data.Query().from('Customers').select(['ContactName', 'CustomerID']).take(6);
query = (e.text !== '' && e.text.length >= 3) ? query.where('ContactName', 'startswith', e.text, true) : query;
e.updateData(CBObj.dataSource, query);
}
</script> |
Please get back us if you need further assistance.
Regards,
Ponmani M