effective_datatables 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/effective_datatables.bootstrap2.js +1 -1
- data/app/assets/javascripts/effective_datatables.js +1 -1
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +16 -8
- data/app/assets/javascripts/vendor/jquery.dataTables.columnFilter.js +5 -2
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +2 -3
- data/lib/effective_datatables/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 974ccbf528f6947d0eca568ad9af53bb29ee0eca
|
4
|
+
data.tar.gz: 8f3836e0bf9b4b9fc36ee79acd361e47c7c5faae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82c049842341821b4df913db9c7be555b36aee6070c4629df352ae33bdc7b61913bdc5a60a10344697ca2cd2a7b170077830b0e8c0c56ba505abc31c19ccc925
|
7
|
+
data.tar.gz: fa9f8b1485760f5e0ad04be8b9f4d0e08470abc476582452030ebcd6796d6bb7d5c9476ef790359c6ee62a70949b26bea6f76af3edd832cdedd08c06e0d90f76
|
@@ -7,6 +7,6 @@
|
|
7
7
|
//= require_tree ./effective_datatables
|
8
8
|
|
9
9
|
$.extend( $.fn.dataTable.defaults, {
|
10
|
-
'dom': "<'row'<'col-xs-
|
10
|
+
'dom': "<'row'<'col-xs-6'l><'col-xs-6'TC>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>"
|
11
11
|
});
|
12
12
|
|
@@ -21,16 +21,27 @@ initializeDataTables = ->
|
|
21
21
|
iDisplayLength: 25
|
22
22
|
fnServerParams: (aoData, a, b) ->
|
23
23
|
table = this.DataTable()
|
24
|
-
table.columns().flatten().each (index) ->
|
24
|
+
table.columns().flatten().each (index) -> # Pass which columns are visible back to server
|
25
25
|
aoData.push({'name': "sVisible_#{index}", 'value': table.column(index).visible()})
|
26
|
+
|
27
|
+
# If this is the very first request to the server we have to manually set any selected filter options here
|
28
|
+
# So that we can skip an fnFilter call in the dataTables.columnFilter that results in a double AJAX call
|
29
|
+
((sEcho = data; break) if data.name == 'sEcho') for data in aoData
|
30
|
+
if sEcho && sEcho.value == 1
|
31
|
+
$.each (datatable.data('filter') || []), (index, filter) ->
|
32
|
+
if(filter.selected)
|
33
|
+
sSearch = undefined
|
34
|
+
((sSearch = data; break) if data.name == "sSearch_#{index}") for data in aoData
|
35
|
+
sSearch.value = filter.selected if sSearch
|
36
|
+
|
26
37
|
aoColumnDefs: aoColumnDefs
|
27
38
|
aoColumns: datatable.data('widths')
|
28
39
|
oTableTools:
|
29
40
|
sSwfPath: '/assets/effective_datatables/copy_csv_xls_pdf.swf',
|
30
|
-
aButtons: ['
|
41
|
+
aButtons: ['csv', {'sExtends': 'xls', 'sButtonText': 'Excel'}, 'print']
|
31
42
|
colVis:
|
32
43
|
showAll: 'Show all'
|
33
|
-
restore: '
|
44
|
+
restore: 'Show default'
|
34
45
|
activate: 'mouseover'
|
35
46
|
fnStateChange: (iCol, bVisible) ->
|
36
47
|
table = $(this.dom.button).closest('.dataTables_wrapper').children('table').first().DataTable()
|
@@ -44,7 +55,9 @@ initializeDataTables = ->
|
|
44
55
|
init_options['dom'] = "<'row'r>t" # Just show the table
|
45
56
|
|
46
57
|
# Actually initialize it
|
58
|
+
console.log('blah')
|
47
59
|
datatable = datatable.dataTable(init_options)
|
60
|
+
console.log('initted')
|
48
61
|
|
49
62
|
if filter
|
50
63
|
datatable.columnFilter
|
@@ -52,10 +65,5 @@ initializeDataTables = ->
|
|
52
65
|
aoColumns : datatable.data('filter')
|
53
66
|
bUseColVis: true
|
54
67
|
|
55
|
-
$('.dataTables_filter').each ->
|
56
|
-
$(this).html("<button class='btn-reset-filters ColVis_Button' data-effective-datatables-reset-filters='true'><span>Reset Filters</span></button>")
|
57
|
-
|
58
68
|
$ -> initializeDataTables()
|
59
69
|
$(document).on 'page:change', -> initializeDataTables()
|
60
|
-
|
61
|
-
$(document).on 'click', '[data-effective-datatables-reset-filters]', (event) -> window.location.reload()
|
@@ -404,8 +404,11 @@
|
|
404
404
|
oTable.fnFilter(unescape($(this).val()), iColumn); //Issue 25
|
405
405
|
fnOnFiltered();
|
406
406
|
});
|
407
|
-
|
408
|
-
|
407
|
+
// Commented out by Matt.
|
408
|
+
// Removing this and hackign the fnServerParams for the first request
|
409
|
+
// Prevents a double AJAX call
|
410
|
+
// if (currentFilter != null && currentFilter != "")//Issue 81
|
411
|
+
// oTable.fnFilter(unescape(currentFilter), iColumn);
|
409
412
|
}
|
410
413
|
}
|
411
414
|
|
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: 1.2.
|
4
|
+
version: 1.2.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-
|
11
|
+
date: 2015-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|