Select2 Tagging issue.
Select2 Tagging issue.
Hi Allan,
Sorry for troubling you so often.. but
I am trying to use Select2 plugin with Tagging enabled.
Although it works correctly, but I am facing 1 issue in editing
When i try and edit a record, the tags/selectoptions are not pre populated in the select box.. and when I try and update the data manually it shows all the tags as selectable options and not tags..
Kindly please help me with this.
you can find the entire JS here...
http://gadhiya.in/web/js/commodity_transaction_field.js
Regards
Kaustubh
Answers
Hi,
Could you give me a link to the page that shows the issue so I can debug it with the live data please? I don't immediately see the issue, although if you could remove the
initEdit
event handler as well, that would be good, since it shouldn't be required.Allan
hi Allan Please find the details
I can see the options as select options... but not as tags...
kindly help me with debugging this.
1 more thing...
I Want the tags to be passed to my api as CSV string but currently they are passed as array.. and vice versa as well.. from API currently I am returning an array but I Want it to be populated from a CSV string.
I thing I might have to update the value in preCreate events... but cant seem to figure that out.
Kindly help me..
Additionally,
when the select field is empty, the field is not included as a parameter to API Call.
which is a problem for me..
What I am looking for is ..
1) Even if the field is blank. a blank parameter should be sent to the API
2) if I select N options from dropdown, they should be sent to API as comma seperated string and not an array.
3) When my API returns a Comma seperated string, it should properly populate the tags with the returned data..
Regards
Allan... have you got time to check on this ?