Sha256: d41d4f30eef1877cea6487357f7a558bc607fd4484795e63a537bd8708ac8d65

Contents?: true

Size: 1.21 KB

Versions: 35

Compression:

Stored size: 1.21 KB

Contents

module Effective
  module EffectiveDatatable
    module Hooks

      # Called on the final collection after searching, ordering, arrayizing and formatting have been completed
      def finalize(collection) # Override me if you like
        collection
      end

      # Override this function to perform custom searching on a column
      def search_column(collection, table_column, search_term, sql_column_or_array_index)
        if table_column[:array_column]
          array_tool.search_column_with_defaults(collection, table_column, search_term, sql_column_or_array_index)
        else
          table_tool.search_column_with_defaults(collection, table_column, search_term, sql_column_or_array_index)
        end
      end

      # Override this function to perform custom ordering on a column
      # direction will be :asc or :desc
      def order_column(collection, table_column, direction, sql_column_or_array_index)
        if table_column[:array_column]
          array_tool.order_column_with_defaults(collection, table_column, direction, sql_column_or_array_index)
        else
          table_tool.order_column_with_defaults(collection, table_column, direction, sql_column_or_array_index)
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
effective_datatables-2.6.21 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.9.0 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.8.0 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.7.0 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.20 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.19 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.18 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.17 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.16 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.15 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.14 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.13 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.12 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.11 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.10 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.9 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.8 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.7 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.6 app/models/effective/effective_datatable/hooks.rb
effective_datatables-2.6.5 app/models/effective/effective_datatable/hooks.rb