-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ComboBox: server-side filtering of the options? #369
Comments
I thought ComboBox filtered the options by setting the List's |
It does set List's
https://github.com/ibm-js/deliteful/blob/master/ComboBox.js#L308 The filtering mechanism has been reworked quite a lot in dstore wrt. dojo/store. Since July, dstore has introduced a dstore/Filter API: The subject seems still "alive", see dojo/dojo1-dstore#44 or dojo/dojo1-dstore#34. This might be already the way to go, but whether this is working well for server-side filtering it needs to be checked. The purpose of this issue is precisely to investigate what's the best we can do. |
dstore/Filter is "just" a way to easily build a filter object. For your case you should probably do something like the following (using regexp): var filter = new Filter();
list.query = filter.match("label", /abc/); This will work as-is with dstore/Memory and should work with dstore/Rest if the server is correctly implementing the filtering. |
Yes. Now, the require of dstore modules has been removed recently from our widgets (Combobox, List). To use the Filter API we'd need to put back a dependency on dstore (for the Filter module itself). |
Right. An alternate approach is to generate yourself the object that is generated by Filter, Filter is after all just a utility. It should generate something like the following (to be double checked): list.query = { type: "and", args: ["label", /abc/] } |
As we have seen, this does not seem to do the trick. Hence the use of dstore/Filter in 24e5f71. |
… server-side filtering (if the data store supports it). Fixes #369
… server-side filtering (if the data store supports it). Fixes ibm-js#369
Currently, ComboBox implements the (optional) filtering the options using a filter function executed client-side.
What about server-side filtering, or at least a mechanism allowing the user to implement it?
Requires investigation.
As a side note related with filtering, it might be nice that, if no item matches the query thus the list is empty, the popup shows some specific graphic feedback (to be defined).
The text was updated successfully, but these errors were encountered: