Is it possible for DHTMLX to have a filter based on a substring? Let’s say in my combobox I have 3 values. “Headphones”, “Horn”, “Neverland”. When I type “Ne”, I want to get the results “Headphones” and “Neverland”.
Next bit of code works, but I have to unfocus the combobox and focus on it again to see the results…
var myValues = [ "Headphones", "Horn", "Neverland"];
var myCombobox = new dhx.Combobox("myDropdown", { placeholder: "select a value"};
myCombobox.data.parse(myValues);
myCombobox.events.on('Input', function(val) {
var filteredVals = myValues.filter((str) => {
return str.value.toLowerCase().indexOf(val.toLowerCase()) >= 0
})
myCombobox.data.parse(filteredVals)
})
So what I would like is when I type “Ne” the values in the combobox change to “Headphones” and “Neverland”.
Thanks in advance!
K