effective_datatables 2.1.2 → 2.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8936f9d6cfd2f9ca5a02c280c4f388526429dc15
|
4
|
+
data.tar.gz: 35401b2a9625a6f6160401d9c6efb311f29d2321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e10681215022737bd36e39088b505365873a0ea63f3a419771579f7832a6b81fde1edc81f8601db1af7dce940c01a6b12b196f90eac880fbc730e4d6d1d5fbdb
|
7
|
+
data.tar.gz: d243ff06c93761d84146fe39263db11ac0bd3665664da926d676e723541b7d153365ba59106c6ea1feafcf56d271b00bddb971c7e0c4b9a81c1f1a4a9be8495a
|
@@ -86,6 +86,10 @@ initializeDataTables = ->
|
|
86
86
|
# leftColumns: 2
|
87
87
|
# )
|
88
88
|
|
89
|
+
# Apply EffectiveFormInputs to the Show x per page dropdown
|
90
|
+
if datatable.data('effective-form-inputs')
|
91
|
+
table.closest('.dataTables_wrapper').find('.dataTables_length select').select2()
|
92
|
+
|
89
93
|
new $.fn.dataTable.ColReorder(table)
|
90
94
|
|
91
95
|
$ -> initializeDataTables()
|
@@ -51,6 +51,8 @@ module Effective
|
|
51
51
|
cols[name][:visible] = true if cols[name][:visible].nil?
|
52
52
|
|
53
53
|
# Type
|
54
|
+
cols[name][:type] ||= cols[name][:as] # Use as: or type: interchangeably
|
55
|
+
|
54
56
|
cols[name][:type] ||= (
|
55
57
|
if belong_tos.key?(name)
|
56
58
|
:belongs_to
|
@@ -115,6 +117,9 @@ module Effective
|
|
115
117
|
# This is a fix for passing filter[:selected] == false, it needs to be 'false'
|
116
118
|
filter[:selected] = filter[:selected].to_s unless filter[:selected].nil?
|
117
119
|
|
120
|
+
# If you pass values, just assume it's a select
|
121
|
+
filter[:type] ||= :select if filter.key?(:values)
|
122
|
+
|
118
123
|
# Check if this is an aggregate column
|
119
124
|
if ['SUM(', 'COUNT(', 'MAX(', 'MIN(', 'AVG('].any? { |str| sql_column.include?(str) }
|
120
125
|
filter[:sql_operation] = :having
|
@@ -17,7 +17,8 @@
|
|
17
17
|
'display-entries' => datatable.display_entries,
|
18
18
|
'display-records' => (datatable.to_json[:recordsFiltered] || 0),
|
19
19
|
'total-records' => (datatable.to_json[:recordsTotal] || 0),
|
20
|
-
'column-classes' => datatable_column_classes(datatable)
|
20
|
+
'column-classes' => datatable_column_classes(datatable),
|
21
|
+
'effective-form-inputs' => defined?(EffectiveFormInputs)
|
21
22
|
}
|
22
23
|
}
|
23
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_datatables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code and Effect
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|