Module: ActionTabler::HasTableAction::DeclaredInstanceMethods

Defined in:
lib/action_tabler/has_table_action.rb

Overview

ClassMethods

Instance Method Summary collapse

Instance Method Details

#column_name_for_json(name) ⇒ Object

Translate . to dot



103
104
105
# File 'lib/action_tabler/has_table_action.rb', line 103

def column_name_for_json(name)
  name.gsub(".", "_dot_")
end

#column_name_from_json(name) ⇒ Object

Translate dot to .



108
109
110
# File 'lib/action_tabler/has_table_action.rb', line 108

def column_name_from_json(name)
  name.gsub("_dot_", ".")
end

#render_datatables_table_definitionsObject



112
113
114
115
116
117
118
# File 'lib/action_tabler/has_table_action.rb', line 112

def render_datatables_table_definitions
  table_options = {:bProcessing => true, :bServerSide => true, :sAjaxSource => url_for}.update(action_tabler_table_options)
  table_options[:fnServerParams] ||= render_passed_parameters(@table_parameters) if @table_parameters
  table_options[:aoColumnDefs] ||= datatables_column_definitions
  
  "{" + table_options.collect{|k,v| render_datatables_attribute(k, v)}.join(", \n") + "}"
end