Method: Wice::GridRenderer#action_column
- Defined in:
- lib/grid_renderer.rb
#action_column(opts = {}) ⇒ Object
Adds a column with checkboxes for each record. Useful for actions with multiple records, for example, deleting selected records. Please note that action_column only creates the checkboxes and the ‘Select All’ and ‘Deselect All’ buttons, and the form itelf as well as processing the parameters should be taken care of by the application code.
-
:param_name- The name of the HTTP parameter. The complete HTTP parameter is"#{grid_name}[#{param_name}][]". The default param_name is ‘selected’. -
:td_html_attrs- a hash of HTML attributes to be included into thetdtag. -
:select_all_buttons- show/hide buttons ‘Select All’ and ‘Deselect All’ in the column header. The default istrue. -
:object_property- a method used to obtain the value for the HTTP parameter. The default isid.
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/grid_renderer.rb', line 150 def action_column(opts = {}) if @action_column_present raise Wice::WiceGridException.new('There can be only one action column in a WiceGrid') end = { :param_name => :selected, :td_html_attrs => {}, :select_all_buttons => true, :object_property => :id } opts.assert_valid_keys(.keys) .merge!(opts) @action_column_present = true @columns << ActionViewColumn.new(@grid, [:td_html_attrs], [:param_name], [:select_all_buttons], [:object_property], @view) end |