michaelperrin/ajax-chosen

Example for optgroup functionality is incorrect

Opened this issue · 0 comments

You're missing required quotes in several places, and the optgroup needs to be called "name", not "text" (or the sample script needs to be changed to read text: val.text instead of text: val.name)

[{
"group": true,
"name": "Europe",
"items": [
{ "value": "10", "text": "Stockholm" },
{ "value": "23", "text": "London" }
]
},
{
"group": true,
"name": "Asia",
"items": [
{ "value": "36", "text": "Beijing" },
{ "value": "20", "text": "Tokyo" }
]
}]