jquery-tokeninput icon indicating copy to clipboard operation
jquery-tokeninput copied to clipboard

Handle additionnal data (not only id and name)

Open maphe opened this issue 11 years ago • 1 comments

If data provided by the query contains more than just an id and a name, we might want to collect them on form submition.

Example :

{
    "id": 12,
    "name": "Alabama",
    "country_code": "US"
}

With this commit, the option returnAsJson, if true, makes the form submit the full objects in a json string, instead of juste ids between separators. Example :

[{"id": 12, "name": "Alabama", "country_code": "US"},{"id": 16, "name": "Alberta", "country_code": "CA"}]

instead of

12,16

Optionnaly, new callback dataFilter allows data transformation on client side.

maphe avatar Nov 14 '13 14:11 maphe

ping @loopj

hugohenrique avatar Nov 27 '13 02:11 hugohenrique