-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
clearOptions should not clear items #593
Comments
But couldn't your fix clear the input-field if the query was really fast or really slow? $('#select-state').selectize({
onType: function(){
ajaxquery && ajaxquery.abort();
this.$input[0].selectize.renderCache = {};
this.$input[0].selectize.clearOptions();
this.$input[0].selectize.refreshOptions(true);
},
load: function(query, callback) {
if (!query.length) return callback();
ajaxquery && ajaxquery.abort();
ajaxquery = $.ajax({
url: '/?q=' + encodeURIComponent(query),
type: 'GET',
dataType: 'json',
error: function() {
callback();
},
success: function(res) {
callback(res);
}
});
}
}); |
This is nonsense why it's still open. You should just remove |
I can confirm for silent. Not working for add item |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This is wrong proposition. For example you have list 1,2, user selected 7. Is this expected? No, because there is no 7 on the list. |
Imho, this is bad design - method is called For example in my case - I need to delete all options all the time, because I am calling backend with every pressed letter on keyboard. Then user selects what they need and I close options and delete them - ready for next query. When they select everything they need, they submit results with button. In version |
Its true what he said, remove the clear and use it like this example: it works like butter 👍 // Functie om gebruikers op te halen en dropdown te vullen met behulp van Selectize
} |
Due to a merge conflict between two incompatible feature requests, we now have the worst of both worlds: |
The clearOptions() method results in the clear() method also being called. Given the logical distinction between "options" and "items" this seems incorrect. The behavior also prevents (unless I'm missing another approach) the use case of providing a new set of options for each item, as follows:
$('#select-state').selectize({
load: function(query, callback){
this.clearOptions();
//fetch the new options
}
});
The text was updated successfully, but these errors were encountered: