如何从 MooTools 自动完成器的数据库中获取建议文本?

发布于 2024-12-19 09:29:49 字数 175 浏览 1 评论 0原文

我需要一个文本区域多自动完成器,例如 this

但是,在示例中,选项是本地的。有谁知道我如何从数据库中获取我的选项?

I need a textarea multi auto-completer like this.

However, in the example, the options are local. Does anyone know how I could get my options from a database?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

与他有关 2024-12-26 09:29:49

您只需初始化 tokens 数组即可从数据库中获取所有值。请注意,仅当从数据库中获取的单词数不太大(最多数百、半千)时,这才有效。

如果这不是您的情况,并且您的数据库中有很多单词,那么您必须考虑 AJAX 自动完成器解决方案。

You can simply initialize the tokens array fetching all the values from the database. Be careful, this is good only if the number of words fetched fromm the database is not too big (hundreds, half a thousand maximum).

If it's not your case, and you have lots of words in your database, you have to think about an AJAX autocompleter solution.

美人迟暮 2024-12-26 09:29:49

我刚刚发布了一个,因为很多人似乎都在追求这种标记(我责怪 google+),并且我已经将其编写并放在我的 github 存储库中。

如果您可以从源代码中解决它,因为我没有时间记录和支持这一点,祝您好运: http: //mootools.net/forge/p/mootagify

提示:您传递已配置的 Request.JSON 实例,您设置该实例来获取标签 - onSuccess 事件由 autoCompleter 处理班级(这是一个独立的)。

github来源:https://github.com/DimitarChristoff/mooTagify/

I've just released one since a lot of people seem to be after this kind of tagging (I blame google+) and I had it written and in my github repos already.

If you can work it out from the source as I have no time to document and support this, good luck: http://mootools.net/forge/p/mootagify

hint: you pass on the configured Request.JSON instance, which you setup to get the tags - the onSuccess event is handled by the autoCompleter class (which is a standalone).

github sources: https://github.com/DimitarChristoff/mooTagify/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文