select2 AJAX return format
select2 AJAX return format
Good morning
Have a select2 input field for a table which works fine for selecting several values and are stored as an INT array in Postgresql.
But...how has the JSON returned to look like so it shows correctly in the editor?
thank sin advance
richard
Answers
An array of objects with
label
/value
attributes is what the plugin is configured for by default (like the other "select" type fields in Editor). But you can use theoptionsPair
parameter for the field to modify that if you need.Allan
Well...think sorted it out...the returned JSON has to look like:
Not as label/value pair...
Now have to figure out what is the fastest way to convert from pgsql array to PHP array (o;