Welcome to the JavaScript feedback portal. We’re happy you’re here! If you have feedback on how to improve the JavaScript, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
When providing a custom 'filtering' function, the default function is still executed as well, at least one time. The default function stops being used only after the custom filtering function has finished executing.
This manifests as 2 requests to the server for data per keypress, until the first execution of the custom filtering function has completed, after which there will only be one request to the server per keypress.
The request generated by the default filtering function can be identified as it uses 'startswith' (unless changed using filterType) while my customer function uses 'contains'.
Example snippet of code:
var combobox = new ej.dropdowns.ComboBox({dataSource: new ej.data.DataManager({ url: 'documents_functions_ajax.php?action=list_customers_and_leads', adaptor: new ej.data.UrlAdaptor() }),query: new ej.data.Query().take(batch_size),sortOrder: 'Ascending',fields: { text: 'name', value: 'id' },placeholder: 'Search for a customer or lead',allowCustom: false,allowFiltering: true,filtering:e => {e.updateData(combobox.dataSource, combobox.query.clone().where('name', 'contains', e.text, true))},})combobox.appendTo(my_input)