ivaynberg/select2 — pull request #253 by ProLoser (2012-07-21 02:14:01+00:00)
Title: Passing a string to select2('val') with initSelection causes it to be used

Fixes #224.

Unfortunately there is a bit of an inconsistency with how select2(val) and select2(data) is used. I think it would be better instead of having any flexibilty to instead make it explicit.

If you use 'data', you MUST pass an object (or array of objects). If you use 'val', you MUST pass a string, or a comma-deliminated string. Use of initSelection would of course depend on if it's defined, and setting the value to a false-ish value should work in either case.