I'm using Select2 as a tagging feature for users,
1 is the select2 listed directly in the label, including the user input, together to the background, and then processing, now stuck in a set of data into the background, I need to detect the label duplication, and only store non-duplicate tags, continue to use, how do I do this label function?
2 using SELECT2 Ajax to store tags in advance, how do you use Select2? How does the Ajax return value be tied to the input box? Do you use the DOM operation?
How is the default value in 3select2 canceled? and binding
Thank you!
Reply content:
I'm using Select2 as a tagging feature for users,
1 is the select2 listed directly in the label, including the user input, together to the background, and then processing, now stuck in a set of data into the background, I need to detect the label duplication, and only store non-duplicate tags, continue to use, how do I do this label function?
2 using SELECT2 Ajax to store tags in advance, how do you use Select2? How does the Ajax return value be tied to the input box? Do you use the DOM operation?
How is the default value in 3select2 canceled? and binding
Thank you!
Finally, the problem is solved first, the function of the label has been completed.
Use Select2, and then send the data to the background for processing, Select2 passed over the existing label is the tag ID, this time with this ID to determine whether the ID exists, if there is skip the cycle, the other values insert tag name, get tag ID, The tag ID corresponding to the previous array of the key to modify, and then the resulting array is all ID number, directly stored.
However, there may be a problem: if you enter a label name that already exists with the same name as the ID number, it will be filtered together