Class: Trestle::Table::SelectColumn::Renderer

Inherits:
Column::Renderer show all
Defined in:
lib/trestle/table/select_column.rb

Instance Method Summary collapse

Methods inherited from Column::Renderer

#initialize, #render, #render?

Constructor Details

This class inherits a constructor from Trestle::Table::Column::Renderer

Instance Method Details

#classesObject



23
24
25
# File 'lib/trestle/table/select_column.rb', line 23

def classes
  "select-row"
end

#content(instance) ⇒ Object



19
20
21
# File 'lib/trestle/table/select_column.rb', line 19

def content(instance)
  checkbox "selected[]", instance.to_param, id: checkbox_id(instance.to_param), data: { checkbox_select_target: "checkbox", action: "change->checkbox-select#toggle" }
end

#dataObject



27
28
29
# File 'lib/trestle/table/select_column.rb', line 27

def data
  {}
end

#headerObject



15
16
17
# File 'lib/trestle/table/select_column.rb', line 15

def header
  checkbox "", nil, id: checkbox_id("all"), data: { checkbox_select_target: "selectAll", action: "change->checkbox-select#toggleAll" }
end