I am trying to use the Select2 plugin to have 4 dropdown lists that depend on each other. I have struggled to find the right way to update the data that loads the options in.
var data=[...];
$().select2({data: function() {return {results:data};}});
/// later
data=[...something else];
// next query select2 will use 'something else' data