datatables_rails 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/datatables_rails.rb +13 -3
  2. metadata +5 -5
@@ -1,11 +1,21 @@
1
1
  module DatatablesRails
2
2
  module Out
3
+ CUSTOM_MAPPINGS = {:process => "bProcessing", :jqueryui => "bJQueryUI", :paginate => "bPaginate",
4
+ :autowidth => "bAutoWidth", :defer_render => "bDeferRender",
5
+ :destroy => "bDestroy", :filter => "bFilter", :info => "bInfo",
6
+ :length_change => "bLengthChange", :retrieve => "bRetrieve",
7
+ :scroll_collapse => "bScrollCollapse", :scroll_infinite => "bScrollInfinite",
8
+ :searchable => "bSearchable", :server_side => "bServerSide",
9
+ :sort => "bSort", :sortable => "bSortable", :sort_cells_top => "bSortCellsTop",
10
+ :sort_classes => "bSortClasses", :state_save => "bStateSave",
11
+ :use_rendered => "bUseRendered", :visible => "bVisible"
12
+ }
3
13
  class << self
4
14
  def javascript(id, opts, source, cols)
5
15
  dt_opts = []
6
- dt_opts << "'bProcessing': true" if opts[:process]
7
- dt_opts << "'bJQueryUI': true" if opts[:jqueryui]
8
- dt_opts << "'bPaginate': true" if opts[:paginate]
16
+ opts.each do |k,v|
17
+ dt_opts << "'#{CUSTOM_MAPPINGS[k]}':true" if v
18
+ end
9
19
  dt_opts << "'sAjaxSource': '#{source}'"
10
20
  columns = []
11
21
  cols.each do |col|
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datatables_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Josh Rendek
@@ -18,7 +18,7 @@ cert_chain: []
18
18
  date: 2011-12-01 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
- description: A wrapper around datatables to return the proper JSON datastructures and output html
21
+ description: A sane API for working with datatables data structures and javascript output
22
22
  email: josh@bluescripts.net
23
23
  executables: []
24
24
 
@@ -60,6 +60,6 @@ rubyforge_project:
60
60
  rubygems_version: 1.8.10
61
61
  signing_key:
62
62
  specification_version: 3
63
- summary: A wrapper around datatables to return the proper JSON datastructures and output html
63
+ summary: A sane API for working with datatables data structures and javascript output
64
64
  test_files: []
65
65