Fork me on GitHub

filter

An article by Gaspard Bucher

Insert a form to create ajax calls to update the current block.

Insert a form to create ajax calls to update the current block.

  • key parameter name to use as filter attribute.
  • update (optional) target to update.
  • loading (optional) true | javascript function
see block

See “block” and implemented funky filtering for examples.

Any argument passed in the “filter” method will passed through during the update (just like link).

<r:filter sel='#{params[:sel]}' update='foo' key='f'/>
<div do='block' name='foo'>
  "sel" parameter passed through: <b do='params[:sel]'/><br/>
  filter parameter "f": <b do='params[:f]'/>
</div>

loading

If you set loading to ‘true’, this will simply change the updated target to have “zloading” class until the part is updated. Here is an example with the whole form and a “loading” parameter.

<r:filter loading='true' update='foo'>
  <r:select param='f' values='hello,goodbye'/>
  <r:input param='g'/>
</r:filter>
<div do='block' name='foo'>
  filter parameter "f": <b do='params[:f]'/>
</div>