effective_datatables 3.0.11 → 3.0.12

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: 26947cf7b14ada26ae6389b6a0af0f8daca8dfef
4
- data.tar.gz: 97f74782767e176a67369fa9773a36019f29cab7
3
+ metadata.gz: 2a1626857c2a0dd2d2d4e730186ff2123cedf701
4
+ data.tar.gz: 7a80e24148043b834218b0162e51c346a1d9856a
5
5
  SHA512:
6
- metadata.gz: 9369d9157d9dd721d46f8bb8bba0edde23717e509960a7aa9a264db62ad31b2df0790305b117aa2683feebcecde90be8cd390cb7ee9f273ae3256b3f12c6170c
7
- data.tar.gz: 314be80b76661a21f5a037e9950282daa54536410c62b9acbcb03ff203e64eeb83a04281a38376fb82a84958eb6826260bfc3a264ed69a8fe8b400459e8c404b
6
+ metadata.gz: adf07bd4b115a2b41105ee02757aa338c330cb9fe7a9d643d8c1c13cd96d3bcb6d6acc15bc45c4c3e3f097dde54a2cd3ea4fef8192f626bf95f2a07e389fe372
7
+ data.tar.gz: 03d4581beee321e9101f2cde363759214be28e2d4ade1271b07ab95eacb2ebeef466c9742f6cdfbb8861b226cba61e66e3811d46bce05d77a264b15243007dda
data/README.md CHANGED
@@ -861,7 +861,9 @@ The built-in search and ordering can be overridden on a per-column basis.
861
861
 
862
862
  The only gotcha here is that you must be aware of the type of collection.
863
863
 
864
- In the case of a `col` and an ActiveRecord-based collection:
864
+ ### With ActiveRecord collection
865
+
866
+ In the case of a `col` and an ActiveRecord collection:
865
867
 
866
868
  ```ruby
867
869
  collection do
@@ -885,7 +887,15 @@ datatable do
885
887
  end
886
888
  ```
887
889
 
888
- And in the case of a `col` with an Array-based collection, or any `val`:
890
+ If you run into issues where `collection` here is an Array, you're probably using some joins in your `collection do ... end` block.
891
+
892
+ If `column[:sql_column].blank?` then this `col` has fallen back to being a `val`.
893
+
894
+ Try adding `col :post_category, sql_column: 'post_categories.title'`
895
+
896
+ ### With Array collection
897
+
898
+ And in the case of a `col` with an Array collection, or any `val`:
889
899
 
890
900
  ```ruby
891
901
  collection do
@@ -1,7 +1,11 @@
1
- $(document).on 'click', 'a.buttons-reset-cookie', (event) ->
2
- event.preventDefault()
1
+ $(document).on 'click', 'a.buttons-reset-search', (event) ->
2
+ event.preventDefault() # prevent the click
3
+
4
+ $table = $(event.currentTarget).closest('.dataTables_wrapper').find('table.dataTable').first()
5
+ $thead = $table.children('thead').first()
6
+
7
+ $thead.find('input').val('').removeAttr('checked').removeAttr('selected')
8
+ $thead.find('select').val('').trigger('change.select2')
9
+
10
+ $table.DataTable().search('').columns().search('').draw()
3
11
 
4
- $obj = $(event.currentTarget)
5
- $obj.find('span').text('Resetting...')
6
- document.cookie = "_effective_dt=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/"
7
- location.reload()
@@ -1,2 +1,2 @@
1
- %a.btn.btn-default.buttons-reset-cookie{href: '#'}
1
+ %a.btn.btn-default.buttons-reset-search{href: '#'}
2
2
  %span Reset
@@ -1,3 +1,3 @@
1
1
  module EffectiveDatatables
2
- VERSION = '3.0.11'.freeze
2
+ VERSION = '3.0.12'.freeze
3
3
  end
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: 3.0.11
4
+ version: 3.0.12
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: 2017-06-13 00:00:00.000000000 Z
11
+ date: 2017-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails