Comments (6)
I just tested here: https://django-formset.fly.dev/bootstrap/state
If I type "son", many counties ending with …son are found. If I type "ky" many counties in Kentucky are found. Yes, it's true that tom-select applies its own filter, but so at least it highlights the matching string.
Do you see any possibility in removing stifer.js, while initializing tom-select?
from django-formset.
I just tested here: https://django-formset.fly.dev/bootstrap/state
If I type "son", many counties ending with …son are found. If I type "ky" many counties in Kentucky are found. Yes, it's true that tom-select applies its own filter, but so at least it highlights the matching string.
When both the back-end and the front-end do the same filtering, then there isn't an issue. The issue arises when the front-end filters differently from the back-end. In the example I gave, the back-end queries two fields (name
and code
) and returns a result if the values of either of them matches the search term. But the front-end only gets the data of the name
field and will apply its filter only against that data.
That means, if you want to find a state based on its code, and you don't include the code values in the options passed to the response such that it is available to sifter (and, of course, if the state's code isn't similar to its name), then you won't find anything.
Another example where I anticipate this could be an issue is full text search and other kinds of similarity searches, because of the normalization applied to the data and the search term that isn't apparent to the front-end.
Though I suppose, you should provide search result highlighting wherever possible so that the user isn't confused about the results - which would then let sifter find the results - it's still odd to have sifter needlessly apply its own filter on top of already filtered results.
Do you see any possibility in removing stifer.js, while initializing tom-select?
Setting searchField
to an empty list seems to remove the filtering aspect while retaining the match highlighting: https://jsfiddle.net/o3xshkLc/
Seems like the best of both worlds? I don't have the faintest clue how to set that within the django-formset
script though.
from django-formset.
Setting searchField to an empty list seems to remove the filtering aspect while retaining the match highlighting
That could be achieved easily by adding an extra attribute to the Selectize
widget. Any proposal how to name this?
from django-formset.
Wouldn't it be better to just generally set searchField
to an empty list if a search_lookup
is provided to the widget? Because when search_lookup
is set, IncompleteSelectResponseMixin._fetch_options
already does the filtering and sifter's second filtering isn't ever needed. Or am I missing something?
from django-formset.
Wouldn't it be better to just generally set searchField to an empty list if a search_lookup is provided to the widget?
I will try and check if the UX remains the same.
How important is this for you now, or can this feature wait a little bit?
from django-formset.
I can wait.
Is there a way to re-initialize an 'selectize' element with the appropriate searchField value? Doesn't have to be pretty, just a bit of javascript that I can slap into a script block to test things out perhaps? It seems like such a small thing, but I can't figure out how to do it for django-formset
.
from django-formset.
Related Issues (20)
- Editing model with many-to-one relationship HOT 15
- New release needed HOT 1
- Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec. HOT 3
- Not possible to set custom classes on input fields with the tailwind renderer HOT 1
- Problem with cyrillic in selectize widget. HOT 1
- loosing borders in selectize widget after pressing button "Reset to initial" in bootstrap mode HOT 10
- Still have the problem with new release 1.3.9. It happened when I use selectize widget and when I use active search in the widget and it tries to get answer from backend to get new list of options. HOT 6
- ColorField Support HOT 2
- df-disable="true" being ignored HOT 2
- BooleanField shows label twice HOT 2
- Style problem in Selectize widget. HOT 2
- Selectize programmatic value selection. HOT 10
- Event listener for add sibling button HOT 4
- DualSelector regression on v1.3.10 HOT 8
- Submit button shows bummer symbol after okay symbol. HOT 3
- The size of the input window does not change as the window size changes HOT 1
- Selectize widget in sortable FormCollection
- Labels in widget FileUpload shall be configurable
- Render form will always render default template HOT 4
- FormCollections with RichtextArea not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-formset.