diff --git a/select2.js b/select2.js index ee625807..aa0f20a6 100755 --- a/select2.js +++ b/select2.js @@ -672,7 +672,10 @@ opts.initSelection = function (element, callback) { var data = []; $(splitVal(element.val(), opts.separator)).each(function () { - data.push({id: this, text: this}); + var id = this, text = this, tags=opts.tags; + if ($.isFunction(tags)) tags=tags(); + $(tags).each(function() { if (equal(this.id, id)) { text = this.text; return false; } }); + data.push({id: id, text: text}); }); callback(data);