Chosen options, in particular options grouped using optgroup
Chosen options, in particular options grouped using optgroup
Is it possible at all to prrovide an object containing groups of [label/values] to the Chosen editor plugin that would pass on those groupings of options to Chosen to enable it to present/display select options surrounded by the orthodox <optgroup>?
https://editor.datatables.net/plug-ins/field-type/editor.chosen
This discussion has been closed.
Answers
Hi,
I'm sorry to say that this is not something that is currently possible via the Editor API. If they had an API to be able to do it, then it would be possible via that, but I don't see such an API I'm afraid.
Allan
Why would we need an API to make that happen? If we passed well formed, semantic <option> + <optgroup> to Chosen it would render as required surely?
Because it isn't creating options that way. Its using Javascript's
Option
object. Line 38 here:That could be modified to allow for optgroups to also be created, but Editor's pair's method doesn't currently allow for that. If you know what your JSON structure is though, then that might be enough.
Allan