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
Help with "tagData" #1018
Comments
Hi! I need to see a simplified example on jsbin in order to be able to help. Also, it might just be your backend or something in between which is modifying the tags data after they are created. You can ask also in Stackoverflow |
Sorry, I can't reproduce the problem in jsbin since I'm using PHPRunner. |
Could you tell me if the approach I used was the best to get this result? |
The code which you pasted has nothing to do with your problem, this isn't a problem related to Tagify but something else around the code which "feeds" tagify with the value. When does this issue happen?
I don't even know what that means.... what is "registry", there's a million things in this sentence which are unexplained. I need exact steps or a video showing the situation with your voice explaining it to me step by step But again, this feels to me like something completely unrelated to Tagify |
Thanksm yairEO! I will rephrase the question and provide more data. |
Hi, folks! Returning to the subject, let me elaborate better. I have a form to add a student. One of the fields is designated for notes that only managers and teachers can enter. I'm applying Tagify to it through jquery. This code tries to insert the notes by concatenating the current date and the name of the logged manager/professor to the tag value. In the ADD form it is working perfectly fine. But, I have another form I use to editing the records (stored in MySql). When I return to the record via this form in order to change something, the stored tags duplicate current date and user name. If I add a new tag, it works fine, but the old ones look weird. The same code is called in both forms:
Any suggestion? |
Because you are calling Try this approach:cObs.getDispElem().tagify({
duplicates: true,
maxTags: Infinity,
delimiters: "\n|\r",
transformTag(tagData) {
tagData.color = getRandomColor();
tagData.style = "--tag-bg:" + tagData.color;
tagData.date = roxy.currDate;
tagData.user = loggedUser;
},
placeholder: "Obs...",
editTags: false,
pasteAsTags: true,
backspace: false,
templates: {
tag(tagData, tagify){
var _s = this.settings;
return `<tag title="${(tagData.title || tagData.value)}"
contenteditable='false'
spellcheck='false'
tabIndex="${_s.a11y.focusableTags ? 0 : -1}"
class="${_s.classNames.tag} ${tagData.class || ""}"
${this.getAttributes(tagData)}>
<x title='' class="${_s.classNames.tagX}" role='button' aria-label='remove tag'></x>
<div>
<span class="${_s.classNames.tagText}">${proxy.date} | ${proxy.user} : ${tagData[_s.tagTextProp] || tagData.value}</span>
</div>
</tag>`
},
}
}) |
yairEO, just a thought.
That will solve my problem, because the tag value would only be changed in the act of adding a new one. |
There should be no changing of the |
Prerequisites
Hello guys!
I'm giving Tagify a little strange use.
In a form, to add new students, there is a field where some observations can be entered by the operator.
With the code below, I make the observations to be entered with the current date and the operator name.
It's working perfectly.
The problem is when I go back to the registry to edit it. In this case, all observations are updated with the same date and the same operator name.
How could I get around this problem?
I'm using it in jquery mode within PHPRunner.
Thanks!
The text was updated successfully, but these errors were encountered: