rails-tables 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -12,7 +12,7 @@ A clean jQuery datatables DSL
12
12
  [jqd-railscast]: http://railscasts.com/episodes/340-datatables (Episode #340: Datatables)
13
13
  [squeel]: https://github.com/ernie/squeel (Squeel: ActiveRecord 3, improved)
14
14
 
15
- Version: 0.6.3
15
+ Version: 0.6.4
16
16
 
17
17
  Please refer to the [RailsTables Wiki][wiki] for:
18
18
 
@@ -5,6 +5,9 @@ $ ->
5
5
  $(@).data('unsorted', true)
6
6
 
7
7
  @rails_tables = {}
8
+ @rails_tables.columns = (datatable)->
9
+ for column, order of $(datatable).data() when /_ordering/.test(column)
10
+ {asSorting: [ order ], aTargets: [ column.substring(0, column.length - "_ordering".length) ]}
8
11
  @rails_tables.params = (datatable) ->
9
12
  (aoData) ->
10
13
  aoData.push
@@ -25,6 +25,11 @@ class RailsTables::Datatable
25
25
  if self.class.source?
26
26
  options[:source] = self.class.source
27
27
  end
28
+ unless self.initial_orderings.nil?
29
+ self.class.initial_orderings.each do |column, order|
30
+ options["#{column}_ordering".to_sym] = order.to_s
31
+ end
32
+ end
28
33
  options[:unsorted] = 'true'
29
34
  options
30
35
  end
@@ -1,3 +1,3 @@
1
1
  module RailsTables
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-tables
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: