如何从 drupal 7 Ajax 链接中删除 throbber?
我们使用 drupal 7 ajax 框架在页面上加载内容。单击链接后,在处理请求时,链接后会出现一个 throbber。
我找不到有关如何设置或删除颤动器的文档。在形式上它看起来非常简单,但是使用 ajax 链接和回调菜单项我找不到任何文档。
我看到有一个 $settings 变量可以传递给 ajax_command_html 函数,但我没有看到任何关于如何格式化它的文档。
we are using drupal 7 ajax framework to load content on a page. When the link is clicked a throbber shows up after the link while the request is processed.
I can't find documentation on how to set or remove the throbber. In a form it looks really simple, but using an ajax link and a callback menu item I can't find any documentation.
I see that there is a $settings variable that can be passed to the ajax_command_html function, but I don't see any docs as to how it should be formatted.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
当您构建表单项时,您需要定义“进度”属性:
您可以找到更多信息和示例 此处
when you build your form item you need to define the "progress" property:
You can find more information and examples here
您可以通过将显示值设置为 none 来隐藏 div.ajax-progress-throbber:
CSS Injector 等模块 (http ://drupal.org/project/css_injector)可能会有用。
You may just hide the div.ajax-progress-throbber by set the display value to none:
The module like CSS Injector (http://drupal.org/project/css_injector) might be useful.
我找到了我自己问题的答案。需要了解的重要一点是,在 Drupal 7 中可以通过两种方式呈现链接。第一种是使用旧的 l() 函数,另一个使用渲染数组。 Drupal 中的许多主题功能都使用旧样式,并且在使用时不会通过 drupal_prerender_link()。这就是将 php 的设置传递到 js 层的元素预处理的作用。
I found the answer to my own question. The important thing to understand is that there are 2 ways that links can be rendered in Drupal 7. The first is using the old l() function and the other is using a render array. Many of the theme functions in Drupal use the old style and when it's used it is not run through the drupal_prerender_link(). Which is what does the element pre-processing that communicates the settings from php to the js layer.