问题标签 [tag-it]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1434 浏览

javascript - Ko.computed 函数更新两次

由于通过 AJAX 加载数据,我需要在数据到达时更新我的​​数据。

在页面加载时,我在数据库中收集项目。然后根据选择的项目(self.SelectedProject)加载任务和标签的数据。

对于初始化,我为第一个项目加载数据:

然后我继续填充我的标签帮助数组:

这可能看起来很奇怪,也许我这样做是不必要的复杂。我使用 http://aehlke.github.com/tag-it/作为标签管理器,它只需要一个带有 TagNames 的数组。因此,我还没有弄清楚如何直接使用 Tags()-array,尽管我很喜欢。

任务以手风琴形式呈现,我希望将任务标签应用到内容面板中,而我将项目标签用作自动完成功能的标签源......

但是我无法弄清楚为什么我的标签被 ko.computed 应用了 2 次,而它们没有被应用,除非我重新选择没有它的项目。

0 投票
1 回答
290 浏览

jquery - 为什么这个自定义绑定不起作用?

我正在尝试将 tag-it 与淘汰赛一起使用:

这是我的html:

在哪里

我的绑定是这样的:

}

Firebug 告诉我 options.initiateTags() = [ "myTag1", "myTag2" ] 和 options.placeholder = "t-æ-gg"。但 tagit 不显示我的initialTags。为什么?

0 投票
1 回答
84 浏览

javascript - 仅为 Tag-it.js 中的 Fetched Data 创建标签想要验证任何外部数据的创建标签

在使用 Tag-it.js 和它的 css 时,我使用 Ajax 调用获取数据,我只想从获取的数据中创建标签,如果用户在数据之外输入任何外部信息,我不想创建标签。

0 投票
1 回答
249 浏览

jquery - 如何避免 tagit() 插件中的自定义条目

在 rails 4.0 中,我正在尝试使用 jquery tagit() 插件来实现标签输入字段。在这个插件中,用户应该从自动完成列表中选择输入标签,而不是通过自定义条目。在这里如何避免自定义条目?同样在这里,我提到 minLength 为 2,但是当我键入第一个字母本身时,自动完成列表会显示。

对于代码参考,我使用了 https://github.com/aehlke/tag-it

代码是,

如果我提到 allowNewTags: false 也不起作用。

0 投票
1 回答
1029 浏览

jquery - Rails 4:acts_as_taggable_on 与 tag-it

我正在尝试将acts_as_taggable_on 挂钩到标记它以对各种标记具有良好的自动完成效果。

我已经设置了这两个,它似乎工作得很好。我唯一不能开始工作的是自动完成。

Tag-it 为自动完成位使用一组值,如下所示:

1) 我不知道如何将包含数组的 rails 变量发送到availableTags

2) 另一个问题是acts_as_taggable_on 不提供返回所有标签(Tag.all 或其他东西)的方法,因此它使得传递值数组以使自动完成工作变得更加困难。

对这两点有什么想法吗?谢谢!

0 投票
0 回答
246 浏览

tag-it - 如何在 jQuery Tagit 插件中使用 _renderitem 方法

我正在尝试将 jQuery 自动完成 _renderitem 方法与 jQuery tagit 插件一起使用。

有人可以帮我吗?

https://github.com/aehlke/tag-it

http://api.jqueryui.com/autocomplete/#method-_renderItem

提前致谢!

0 投票
1 回答
653 浏览

json - 将 JSON 绑定到 tag-it 中的 availableTags

http://aehlke.github.io/tag-it/ http://aehlke.github.io/tag-it/prototype.js

我试过设置

我的想法是在按钮单击或 DOM 元素上的某些事件上获取所有语言 ID(在自动完成中)如何实现这一点?

我们为此目的使用的 JSON 的结构应该是什么?

0 投票
1 回答
231 浏览

tag-it - tag-it :如何diss允许自由文本

http://aehlke.github.io/tag-it/

我应该怎么做才能避免标签上的自由文本?我的意思是用户应该只能标记自动强制建议的那些字符串

0 投票
1 回答
798 浏览

jquery - JQuery Tag It - Edit tags inline

I have used jQuery tagit which will accept email addresses. I have validated tags for email format. I want to know if it can also edit the tags if user has typed something wrong. Right now we have to remove the tag and reenter if something goes wrong.

Thanks in Advance

0 投票
1 回答
540 浏览

jquery - Maximum number of characters allowed per tag in the jQuery UI plugin Tag-it

Using the jQuery UI plugin Tag-it, it is possible to enter tags with 100s of characters such as:

"loremipsumdolorsitametconsecteturadipisicingelitseddoeiusmodtemporincididuntutlaboreetdoloremagnaaliquautenimadminimveniamquisnostrudexercitationullamco"

I'm trying to set a maximum number of characters allowed per tag. So far I have tried tagLimit but this limits the total number of tags allowed but not the character limit for each tag.

Does anyone know how I could set a limit to the number of characters allowed per tag?