Hi eveyone, I am using q-select component and i'd like to import data from server so everytime user type into searchbox it makes a ajax call and receive the filtered selectable list. I don't know if there's a way to achieve it right know, if there is i'd appretiate any help.
However would be great adding this filter-method as prop, q-table already has it.
I believe this is similar to: https://github.com/quasarframework/quasar/issues/2435
Scott
Hi,
filter prop can be a Function too. Example:
// <q-select :filter="myFilter" ....
function myFilter (terms, obj) {
return obj.label.toLowerCase().indexOf(terms) > -1
}
Updated docs.
@rstoenescu thank you for answering, I hadn't noticed it was possible, even though I tested it and don't gives the option of modifying the complete method, just lets modify the rule inside an already running .filter() bucle of an already formed array. As i said i was expecting to make an ajax call THEN filter the response and return the filtered object. Do you know any way to achieve it?
I also miss this function in q-select. Would be very usefull if implemented!
For large amount of data the component take a few seconds to show the options. With ajax it would be more user friendly and smooth.
I have an example describing the problem: https://github.com/quasarframework/quasar/issues/943#issuecomment-429610400
Most helpful comment
Hi,
filterprop can be a Function too. Example:Updated docs.