Module: Magic::Column

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/extmodules/magic.rb', line 3

def self.included(base)
  base.class_eval do
    define_method :id_to_title do 
      return if @config[:id].nil? 
      @config[:id].split("-").map(&:capitalize) * " "
    end

    alias_method :mod_column, :prepare_config

    define_method :prepare_config do
      mod_column rescue "skip"
      @default_config.merge! :header => id_to_title, :dataIndex => conv_id_to_name unless @config[:id].nil?
      @default_config.merge! :sortable => true
    end
  
  end
end