effective_datatables 3.3.0 → 3.3.1
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 +4 -4
- data/README.md +2 -2
- data/app/assets/javascripts/effective_datatables/initialize.js.coffee +4 -4
- data/app/assets/stylesheets/effective_datatables/_overrides.scss +30 -9
- data/app/models/effective/effective_datatable/dsl/datatable.rb +1 -1
- data/config/effective_datatables.rb +1 -1
- data/lib/effective_datatables/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6617dd89c63c469a1b13e5cc33d42d17d38f485
|
4
|
+
data.tar.gz: 35c4b532d397f4b39a44b4f48cca0014ff9c88b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 408903d12b738461044519d44a608f1d231b153098d699fb37ef85010feb0d746d74a924bd437dcfe8f5affde12267230bb56ba9e1bde4f45348e6319d764a30
|
7
|
+
data.tar.gz: ca62715eec66e12d5dfc332c712ee3fb6c36dcb3aea938dc186a49f6af379e564d69c827f746fc539626a40f8d37005cf0293988ed3983ac13a918dea7db99a8
|
data/README.md
CHANGED
@@ -189,7 +189,7 @@ class PostsDatatable < Effective::Datatable
|
|
189
189
|
# The user's selected filters, search, sort, length, column visibility and pagination settings are saved between visits
|
190
190
|
# on a per-table basis and can be Reset with a button
|
191
191
|
datatable do
|
192
|
-
length 25 # 5, 10, 25, 50, 100,
|
192
|
+
length 25 # 5, 10, 25, 50, 100, 500, :all
|
193
193
|
order :updated_at, :desc
|
194
194
|
|
195
195
|
# Renders a column of checkboxes to select items for any bulk_actions
|
@@ -559,7 +559,7 @@ The `glyphicon_to` helper is part of the [effective_resources](https://github.co
|
|
559
559
|
|
560
560
|
### length
|
561
561
|
|
562
|
-
Sets the default number of rows per page. Valid lengths are `5`, `10`, `25`, `50`, `100`, `250`, `
|
562
|
+
Sets the default number of rows per page. Valid lengths are `5`, `10`, `25`, `50`, `100`, `250`, `500`, `:all`
|
563
563
|
|
564
564
|
When not specified, effective_datatables uses the default as per the `config/initializers/effective_datatables.rb` or 25.
|
565
565
|
|
@@ -49,10 +49,10 @@ initializeDataTables = ->
|
|
49
49
|
deferLoading: [datatable.data('display-records'), datatable.data('total-records')]
|
50
50
|
deferRender: true
|
51
51
|
displayStart: datatable.data('display-start')
|
52
|
-
dom: "<'row'<'col-sm-12'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-
|
52
|
+
dom: "<'row'<'col-sm-12'B>><'row'<'col-sm-12'tr>><'row'<'col-sm-6 dataTables_entries'il><'col-sm-6'p>>"
|
53
53
|
iDisplayLength: datatable.data('display-length')
|
54
|
-
language: { 'lengthMenu': '_MENU_ per page'}
|
55
|
-
lengthMenu: [[10, 25, 50, 100, 250,
|
54
|
+
language: { 'lengthMenu': ' with _MENU_ per page'}
|
55
|
+
lengthMenu: [[10, 25, 50, 100, 250, 500, 9999999], ['10', '25', '50', '100', '250', '500', 'All']]
|
56
56
|
order: datatable.data('display-order')
|
57
57
|
processing: true
|
58
58
|
responsive: true
|
@@ -185,7 +185,7 @@ initializeDataTables = ->
|
|
185
185
|
|
186
186
|
# Apply EffectiveFormInputs to the Show x per page dropdown
|
187
187
|
if datatable.data('effective-form-inputs')
|
188
|
-
try table.closest('.dataTables_wrapper').find('.dataTables_length select').removeAttr('name').select2()
|
188
|
+
try table.closest('.dataTables_wrapper').find('.dataTables_length select').removeAttr('name').select2(minimumResultsForSearch: 100)
|
189
189
|
|
190
190
|
destroyDataTables = ->
|
191
191
|
$('table.effective-datatable').each ->
|
@@ -68,10 +68,38 @@ div.dataTables_wrapper div.dataTables_processing {
|
|
68
68
|
width: 70%;
|
69
69
|
}
|
70
70
|
|
71
|
-
//
|
72
|
-
|
71
|
+
// Datatables entries
|
72
|
+
@media screen and (max-width: 767px) {
|
73
|
+
div.dataTables_wrapper div.dataTables_entries { text-align: center; }
|
74
|
+
}
|
75
|
+
|
76
|
+
.dataTables_wrapper .dataTables_entries {
|
73
77
|
color: #909090;
|
74
78
|
font-size: 12px;
|
79
|
+
|
80
|
+
// Showing 1 to 2 of 2 entries (filtered from 10 total entries)
|
81
|
+
div.dataTables_info {
|
82
|
+
display: inline-block;
|
83
|
+
padding: 5px 0px 6px 6px;
|
84
|
+
}
|
85
|
+
|
86
|
+
// with 25 per page
|
87
|
+
div.dataTables_length {
|
88
|
+
display: inline-block;
|
89
|
+
|
90
|
+
// Apply custom style to the inline x per page select
|
91
|
+
span.select2-container {
|
92
|
+
margin: 0px -3px 3px -3px;
|
93
|
+
max-width: 45px;
|
94
|
+
|
95
|
+
.select2-selection { border: none; }
|
96
|
+
.select2-selection__rendered { padding: 0px; color: #909090; }
|
97
|
+
}
|
98
|
+
|
99
|
+
span.select2-container.select2-container--open { max-width: 60px; }
|
100
|
+
span.select2-container.select2-container--focus { border: none; box-shadow: none; }
|
101
|
+
span.select2-container--focus > .selection > .select2-selection { border: none !important; }
|
102
|
+
}
|
75
103
|
}
|
76
104
|
|
77
105
|
// Buttons
|
@@ -139,13 +167,6 @@ ul.dt-button-collection {
|
|
139
167
|
}
|
140
168
|
}
|
141
169
|
|
142
|
-
// Showing 1 to 25 of 100 entries
|
143
|
-
div.dataTables_wrapper div.dataTables_info {
|
144
|
-
color: #909090;
|
145
|
-
font-size: 12px;
|
146
|
-
padding: 5px 0px 6px 6px;
|
147
|
-
}
|
148
|
-
|
149
170
|
// Collapsed Responsive View
|
150
171
|
table.dataTable > tbody > tr.child {
|
151
172
|
span.dtr-title { min-width: 175px; margin-bottom: 4px; }
|
@@ -11,7 +11,7 @@ module Effective
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def length(length)
|
14
|
-
raise 'length must be 10, 25, 50, 100, 250,
|
14
|
+
raise 'length must be 10, 25, 50, 100, 250, 500, :all' unless [10, 25, 50, 100, 250, 500, :all].include?(length)
|
15
15
|
datatable.state[:length] ||= (length == :all ? 9999999 : length)
|
16
16
|
end
|
17
17
|
|
@@ -21,7 +21,7 @@ EffectiveDatatables.setup do |config|
|
|
21
21
|
config.authorization_method = Proc.new { |controller, action, resource| authorize!(action, resource) } # CanCanCan
|
22
22
|
|
23
23
|
# Default number of entries shown per page
|
24
|
-
# Valid options are: 5, 10, 25, 50, 100, 250,
|
24
|
+
# Valid options are: 5, 10, 25, 50, 100, 250, 500, :all
|
25
25
|
config.default_length = 25
|
26
26
|
|
27
27
|
# Default class used on the <table> tag
|