开发者

How do you remove the throbber from drupal 7 Ajax link?

we are using drupal 7 ajax framework to load开发者_如何学JAVA 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.


when you build your form item you need to define the "progress" property:

$mycheckbox=array(
  '#type' => 'checkbox',
  '#title' => 'Load it up',
  '#ajax' => array(
      'callback' => 'ajax_example_callback', 
      'wrapper' => 'checkboxes-div',
      'effect' => 'slide', 
      'progress' => array('type' => 'none'),
    ),
);

You can find more information and examples here


You may just hide the div.ajax-progress-throbber by set the display value to none:

.ajax-progress-throbber {
  display: none;
}

The module like CSS Injector (http://drupal.org/project/css_injector) might be useful.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜