jquery-datatables-rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.md ADDED
@@ -0,0 +1,14 @@
1
+ This is a gem for Rails >= 3.1 applications. It provides all the basic DataTables files, but not (yet) the extras.
2
+
3
+ # Install and Usage
4
+
5
+ First, put the gem in your Gemfile (`gem 'jquery-datatables-rails'`) and run `bundle install`
6
+
7
+ After installing it you can require it in your _application.js_ file with `\\= require jquery.dataTables.min`, or use the images and stylesheets in the _dataTables_ directory: `<%= image_tag 'dataTables/sortBoth.png' %>`
8
+
9
+ # Plugins
10
+
11
+ Right now, the only plugin that is available is fnReloadAjax. Check out the [assets directory][assets].
12
+
13
+ [assets]: https://github.com/rweng/jquery-datatables-rails/tree/master/vendor/assets/javascripts
14
+
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Jquery::Datatables::Rails::VERSION
8
8
  s.authors = ["Robin Wenglewski"]
9
9
  s.email = ["robin@wenglewski.de"]
10
- s.homepage = ""
10
+ s.homepage = "https://github.com/rweng/jquery-datatables-rails"
11
11
  s.summary = %q{jquery datatables for rails}
12
12
  s.description = %q{}
13
13
 
@@ -1,8 +1,8 @@
1
1
  # Configure for Rails 3.1
2
2
  module Jquery
3
3
  module Datatables
4
- if defined?(::Rails) and Rails.version >= "3.1"
5
- module ::Rails
4
+ if defined?(::Rails) and ::Rails.version >= "3.1"
5
+ module Rails
6
6
  class Engine < ::Rails::Engine
7
7
  end
8
8
  end
@@ -1,7 +1,7 @@
1
1
  module Jquery
2
2
  module Datatables
3
3
  module Rails
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -0,0 +1,44 @@
1
+ $.fn.dataTableExt.oApi.fnReloadAjax = function ( oSettings, sNewSource, fnCallback, bStandingRedraw )
2
+ {
3
+ if ( typeof sNewSource != 'undefined' && sNewSource != null )
4
+ {
5
+ oSettings.sAjaxSource = sNewSource;
6
+ }
7
+ this.oApi._fnProcessingDisplay( oSettings, true );
8
+ var that = this;
9
+ var iStart = oSettings._iDisplayStart;
10
+
11
+ oSettings.fnServerData( oSettings.sAjaxSource, [], function(json) {
12
+ /* Clear the old information from the table */
13
+ that.oApi._fnClearTable( oSettings );
14
+
15
+ /* Got the data - add it to the table */
16
+ for ( var i=0 ; i<json.aaData.length ; i++ )
17
+ {
18
+ that.oApi._fnAddData( oSettings, json.aaData[i] );
19
+ }
20
+
21
+ oSettings.aiDisplay = oSettings.aiDisplayMaster.slice();
22
+ that.fnDraw();
23
+
24
+ if ( typeof bStandingRedraw != 'undefined' && bStandingRedraw === true )
25
+ {
26
+ oSettings._iDisplayStart = iStart;
27
+ that.fnDraw( false );
28
+ }
29
+
30
+ that.oApi._fnProcessingDisplay( oSettings, false );
31
+
32
+ /* Callback user function - for event handlers etc */
33
+ if ( typeof fnCallback == 'function' && fnCallback != null )
34
+ {
35
+ fnCallback( oSettings );
36
+ }
37
+ }, oSettings );
38
+ }
39
+
40
+ /* Example call to load a new file */
41
+ oTable.fnReloadAjax( 'media/examples_support/json_source2.txt' );
42
+
43
+ /* Example call to reload from original file */
44
+ oTable.fnReloadAjax();
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-datatables-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-29 00:00:00.000000000Z
12
+ date: 2011-09-10 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails
16
- requirement: &70208917369280 !ruby/object:Gem::Requirement
16
+ requirement: &70152625226160 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70208917369280
24
+ version_requirements: *70152625226160
25
25
  description: ''
26
26
  email:
27
27
  - robin@wenglewski.de
@@ -32,7 +32,7 @@ files:
32
32
  - .gitignore
33
33
  - Gemfile
34
34
  - Rakefile
35
- - Readme.textile
35
+ - Readme.md
36
36
  - jquery-datatables-rails.gemspec
37
37
  - lib/jquery-datatables-rails.rb
38
38
  - lib/jquery/datatables/rails/engine.rb
@@ -47,6 +47,7 @@ files:
47
47
  - vendor/assets/images/dataTables/sort_both.png
48
48
  - vendor/assets/images/dataTables/sort_desc.png
49
49
  - vendor/assets/images/dataTables/sort_desc_disabled.png
50
+ - vendor/assets/javascripts/jquery.dataTables.fnReloadAjax.js
50
51
  - vendor/assets/javascripts/jquery.dataTables.js
51
52
  - vendor/assets/javascripts/jquery.dataTables.min.js
52
53
  - vendor/assets/javascripts/jquery.dataTables.min.js.gz
@@ -54,7 +55,7 @@ files:
54
55
  - vendor/assets/stylesheets/dataTables/demo_page.css
55
56
  - vendor/assets/stylesheets/dataTables/demo_table.css
56
57
  - vendor/assets/stylesheets/dataTables/demo_table_jui.css
57
- homepage: ''
58
+ homepage: https://github.com/rweng/jquery-datatables-rails
58
59
  licenses: []
59
60
  post_install_message:
60
61
  rdoc_options: []
data/Readme.textile DELETED
@@ -1,8 +0,0 @@
1
- This is a gem for Rails >= 3.1 applications. It provides all the basic DataTables files, but not (yet) the extras.
2
-
3
- h1. Install and Usage
4
-
5
- First, put the gem in your Gemfile (@gem 'jquery-datatables-rails' , :git => 'git://github.com/rweng/jquery-datatables-rails.git'@) and run @bundle install@
6
-
7
- After installing it you can require it in your _application.js_ file with @\\= require jquery.dataTables@, or use the images and stylesheets in the _dataTables_ directory: @<%= image_tag 'dataTables/sortBoth.png' %>@
8
-