I've got one dropdown:
$remote.select2({
allowClear: true,
minimumInputLength: 2,
query: function(options){
$.ajax({
dataType: 'json',
url: myURL + options.term,
error: function(jqXHR, textStatus, errorThrown){
smoke.alert(textStatus + ": server returned error on parsing arguments starting with " + options.term);
},
success: function(data, textStatus, jqXHR){
var results = [];
for(var i = 0; i < data.length; ++i){
results.push({id: data[i].id, text: data[i].name});
}
options.callback({results: results, more: false});
}
});
}
});
with an "input" HTML tag. Once I've selected an item from the drop down list, I'd like to be able at a later date to clear the drop down. I keep getting "Uncaught Error: cannot call val() if initSelection() is not defined." Any way to clear the box?
--
You received this message because you are subscribed to the Google Groups "select2" group.
To view this discussion on the web visit https://groups.google.com/d/msg/select2/-/bJtnBgG3rt0J.
To post to this group, send email to sel...@googlegroups.com.
To unsubscribe from this group, send email to select2+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/select2?hl=en.
Thank you.
BR