1
0
mirror of synced 2024-11-29 16:16:02 +03:00

support null, undefined, false for data() to unselect. fixes #273

This commit is contained in:
Igor Vaynberg 2012-07-27 19:00:17 +03:00
parent 08bf83f1a4
commit f2460a826e

View File

@ -2077,6 +2077,7 @@
.map(function() { return $(this).data("select2-data"); }) .map(function() { return $(this).data("select2-data"); })
.get(); .get();
} else { } else {
if (!values) { values = []; }
ids = $.map(values, function(e) { return self.opts.id(e)}); ids = $.map(values, function(e) { return self.opts.id(e)});
this.setVal(ids); this.setVal(ids);
this.updateSelection(values); this.updateSelection(values);