datatable 0.2pre1 → 0.2pre2
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.
- data/Gemfile.lock +1 -1
- data/example_app/config/initializers/datatable.rb +3 -3
- data/example_app/public/datatable/js/jquery.dataTablesExt.fnSetFilteringDelay.js +38 -0
- data/lib/datatable/helper.rb +2 -0
- data/lib/datatable/version.rb +1 -1
- data/vendor/datatable/media/js/jquery.dataTablesExt.fnSetFilteringDelay.js +38 -0
- metadata +54 -26
data/Gemfile.lock
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
|
2
|
+
/*
|
3
|
+
* Inputs: object:oSettings - dataTables settings object - automatically given
|
4
|
+
* integer:iDelay - delay in milliseconds
|
5
|
+
* Usage: $('#example').dataTable().fnSetFilteringDelay(250);
|
6
|
+
* Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
|
7
|
+
* License: GPL v2 or BSD 3 point style
|
8
|
+
* Contact: zygimantas.berziunas /AT\ hotmail.com
|
9
|
+
*/
|
10
|
+
var
|
11
|
+
_that = this,
|
12
|
+
iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
|
13
|
+
|
14
|
+
this.each( function ( i ) {
|
15
|
+
$.fn.dataTableExt.iApiIndex = i;
|
16
|
+
var
|
17
|
+
$this = this,
|
18
|
+
oTimerId = null,
|
19
|
+
sPreviousSearch = null,
|
20
|
+
anControl = $( 'input', _that.fnSettings().aanFeatures.f );
|
21
|
+
|
22
|
+
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
|
23
|
+
var $$this = $this;
|
24
|
+
|
25
|
+
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
|
26
|
+
window.clearTimeout(oTimerId);
|
27
|
+
sPreviousSearch = anControl.val();
|
28
|
+
oTimerId = window.setTimeout(function() {
|
29
|
+
$.fn.dataTableExt.iApiIndex = i;
|
30
|
+
_that.fnFilter( anControl.val() );
|
31
|
+
}, iDelay);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
return this;
|
36
|
+
} );
|
37
|
+
return this;
|
38
|
+
}
|
data/lib/datatable/helper.rb
CHANGED
@@ -29,6 +29,7 @@ module Datatable
|
|
29
29
|
$(function(){
|
30
30
|
|
31
31
|
var oTable = $('#datatable').dataTable(#{javascript_options.to_json.gsub(/\"aocolumns_place_holder\"/, aocolumns_text)})
|
32
|
+
oTable.fnSetFilteringDelay(375);
|
32
33
|
|
33
34
|
|
34
35
|
$('tfoot input').keyup( function () {
|
@@ -49,6 +50,7 @@ module Datatable
|
|
49
50
|
end
|
50
51
|
|
51
52
|
javascripts << (javascript_include_tag '/datatable/js/jquery.dataTables.min.js')
|
53
|
+
javascripts << (javascript_include_tag '/datatable/js/jquery.dataTablesExt.fnSetFilteringDelay.js')
|
52
54
|
|
53
55
|
if Datatable::Base.config.table_tools == true
|
54
56
|
javascripts << (javascript_include_tag '/datatable/js/TableTools.min.js')
|
data/lib/datatable/version.rb
CHANGED
@@ -0,0 +1,38 @@
|
|
1
|
+
jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
|
2
|
+
/*
|
3
|
+
* Inputs: object:oSettings - dataTables settings object - automatically given
|
4
|
+
* integer:iDelay - delay in milliseconds
|
5
|
+
* Usage: $('#example').dataTable().fnSetFilteringDelay(250);
|
6
|
+
* Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
|
7
|
+
* License: GPL v2 or BSD 3 point style
|
8
|
+
* Contact: zygimantas.berziunas /AT\ hotmail.com
|
9
|
+
*/
|
10
|
+
var
|
11
|
+
_that = this,
|
12
|
+
iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
|
13
|
+
|
14
|
+
this.each( function ( i ) {
|
15
|
+
$.fn.dataTableExt.iApiIndex = i;
|
16
|
+
var
|
17
|
+
$this = this,
|
18
|
+
oTimerId = null,
|
19
|
+
sPreviousSearch = null,
|
20
|
+
anControl = $( 'input', _that.fnSettings().aanFeatures.f );
|
21
|
+
|
22
|
+
anControl.unbind( 'keyup' ).bind( 'keyup', function() {
|
23
|
+
var $$this = $this;
|
24
|
+
|
25
|
+
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
|
26
|
+
window.clearTimeout(oTimerId);
|
27
|
+
sPreviousSearch = anControl.val();
|
28
|
+
oTimerId = window.setTimeout(function() {
|
29
|
+
$.fn.dataTableExt.iApiIndex = i;
|
30
|
+
_that.fnFilter( anControl.val() );
|
31
|
+
}, iDelay);
|
32
|
+
}
|
33
|
+
});
|
34
|
+
|
35
|
+
return this;
|
36
|
+
} );
|
37
|
+
return this;
|
38
|
+
}
|
metadata
CHANGED
@@ -1,35 +1,49 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: datatable
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1923831885
|
5
5
|
prerelease: 3
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 2
|
9
|
+
- pre
|
10
|
+
- 2
|
11
|
+
version: 0.2pre2
|
6
12
|
platform: ruby
|
7
|
-
authors:
|
13
|
+
authors:
|
8
14
|
- Michael Greenly
|
9
15
|
- Mischa Fierer
|
10
16
|
autorequire:
|
11
17
|
bindir: bin
|
12
18
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
19
|
+
|
20
|
+
date: 2011-08-07 00:00:00 Z
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
16
23
|
name: rails
|
17
|
-
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
18
25
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
|
23
|
-
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
version: "3.0"
|
24
34
|
prerelease: false
|
25
|
-
|
35
|
+
type: :runtime
|
36
|
+
requirement: *id001
|
26
37
|
description: A Rails plugin for the jquery.datatables library
|
27
|
-
email:
|
38
|
+
email:
|
28
39
|
- michaelgreenly@logic-refinery.com
|
29
40
|
executables: []
|
41
|
+
|
30
42
|
extensions: []
|
43
|
+
|
31
44
|
extra_rdoc_files: []
|
32
|
-
|
45
|
+
|
46
|
+
files:
|
33
47
|
- .bundle/config
|
34
48
|
- .gitignore
|
35
49
|
- .rspec
|
@@ -119,6 +133,7 @@ files:
|
|
119
133
|
- example_app/public/datatable/js/jquery-ui-1.8.14.custom.min.js
|
120
134
|
- example_app/public/datatable/js/jquery.dataTables.js
|
121
135
|
- example_app/public/datatable/js/jquery.dataTables.min.js
|
136
|
+
- example_app/public/datatable/js/jquery.dataTablesExt.fnSetFilteringDelay.js
|
122
137
|
- example_app/public/favicon.ico
|
123
138
|
- example_app/public/flash/copy_cvs_xls.swf
|
124
139
|
- example_app/public/flash/copy_cvs_xls_pdf.swf
|
@@ -219,28 +234,41 @@ files:
|
|
219
234
|
- vendor/datatable/media/js/jquery-ui-1.8.14.custom.min.js
|
220
235
|
- vendor/datatable/media/js/jquery.dataTables.js
|
221
236
|
- vendor/datatable/media/js/jquery.dataTables.min.js
|
237
|
+
- vendor/datatable/media/js/jquery.dataTablesExt.fnSetFilteringDelay.js
|
222
238
|
homepage: https://github.com/logic-refinery/datatable
|
223
239
|
licenses: []
|
240
|
+
|
224
241
|
post_install_message:
|
225
242
|
rdoc_options: []
|
226
|
-
|
243
|
+
|
244
|
+
require_paths:
|
227
245
|
- lib
|
228
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
246
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
229
247
|
none: false
|
230
|
-
requirements:
|
231
|
-
- -
|
232
|
-
- !ruby/object:Gem::Version
|
233
|
-
|
234
|
-
|
248
|
+
requirements:
|
249
|
+
- - ">="
|
250
|
+
- !ruby/object:Gem::Version
|
251
|
+
hash: 3
|
252
|
+
segments:
|
253
|
+
- 0
|
254
|
+
version: "0"
|
255
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
256
|
none: false
|
236
|
-
requirements:
|
237
|
-
- -
|
238
|
-
- !ruby/object:Gem::Version
|
257
|
+
requirements:
|
258
|
+
- - ">"
|
259
|
+
- !ruby/object:Gem::Version
|
260
|
+
hash: 25
|
261
|
+
segments:
|
262
|
+
- 1
|
263
|
+
- 3
|
264
|
+
- 1
|
239
265
|
version: 1.3.1
|
240
266
|
requirements: []
|
267
|
+
|
241
268
|
rubyforge_project:
|
242
269
|
rubygems_version: 1.8.5
|
243
270
|
signing_key:
|
244
271
|
specification_version: 3
|
245
272
|
summary: A Rails plugin for the jquery.datatables library
|
246
273
|
test_files: []
|
274
|
+
|