Sha256: f6f2e4d0031e0b6e787ad227a6936c19896b23b8120ce75aa106a8af43c26754
Contents?: true
Size: 1.3 KB
Versions: 4
Compression:
Stored size: 1.3 KB
Contents
# encoding: UTF-8 module Wice class ActionViewColumn < ViewColumn #:nodoc: def initialize(grid_obj, html, param_name, select_all_buttons, object_property, view) #:nodoc: @view = view @select_all_buttons = select_all_buttons self.grid = grid_obj self.html = html Wice::WgHash.add_or_append_class_value!(self.html, 'sel') grid_name = self.grid.name @param_name = param_name @cell_rendering_block = lambda do |object, params| selected = if params[grid_name] && params[grid_name][param_name] && params[grid_name][param_name].index(object.send(object_property).to_s) true else false end check_box_tag("#{grid_name}[#{param_name}][]", object.send(object_property), selected, :id => nil) end end def in_html #:nodoc: true end def capable_of_hosting_filter_related_icons? #:nodoc: false end def name #:nodoc: return '' unless @select_all_buttons content_tag(:div, '', :class => 'clickable select-all', :title => NlMessage['select_all']) + ' ' + content_tag(:div, '', :class => 'clickable deselect-all', :title => NlMessage['deselect_all']) end end end
Version data entries
4 entries across 4 versions & 1 rubygems