-
Notifications
You must be signed in to change notification settings - Fork 439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Manually update tag data after it was added #433
Comments
After more digging: |
I understand your need and I have been contemplating on the best approach to allow developers to easily update a tag's properties after it has been created. |
Add |
Thank you @yairEO , your suggestion worked like a charm! |
Hi, and thanks for this beautiful library!
I'm encountering an issue which i hope someone can help me solve here:
I'm trying to programmatically update the tags data properties after the "add" event.
My current behaviour is this:
When a user enter a new tag, i make an ajax call to store the newly added tag in database.
The call response contain the new tag record along with full properties.
What i'm trying to achieve is to update the tagify object with these additional properties (like the "id" value, which i need to be able to use in the remove event).
So far i was not able to do this.
I'm trying to use the
replaceTag
function passing the new data like this:tagify.replaceTag(tagify.getTagElms()[e.detail.index],data.tag);
where data.tag is an object like this:
but this leads me to a notAllowed element.
Is there a way that i can accomplish this? What am i doing wrong?
I've built a very simple pen here that replicates this same behaviour:
https://codepen.io/mzed/pen/eYNWZPB
Thanks for any help!
The text was updated successfully, but these errors were encountered: