Using Chrome Version 32.0.1700.107 m (and whatever I had before I decided to update to see if the latest version worked), I found that setting the selected values via val, such as:
$("select").select2("val", ["CA","MA"]);
then attempting to access any selected data via data such as:
$("select").select2("data");
will not work. It fails and does not produce any return values.
Case in point, the demo site for select2: http://ivaynberg.github.io/select2/
if you go to the "Programmatic Access" section, under the multiple selection buttons, click "Set to California and Massachusetts" then click "Alert selected value using data" will fail with this error in the Chrome console:
Uncaught TypeError: Converting circular structure to JSON
This works in IE11 (didn't check below) and FF 26.0 but not Chrome.
Using Chrome Version 32.0.1700.107 m (and whatever I had before I decided to update to see if the latest version worked), I found that setting the selected values via val, such as:
then attempting to access any selected data via data such as:
will not work. It fails and does not produce any return values.
Case in point, the demo site for select2: http://ivaynberg.github.io/select2/
if you go to the "Programmatic Access" section, under the multiple selection buttons, click "Set to California and Massachusetts" then click "Alert selected value using data" will fail with this error in the Chrome console:
This works in IE11 (didn't check below) and FF 26.0 but not Chrome.