@@ -60,13 +60,13 @@ bundle install
6060
6161```javascript
6262// For fluid containers
63- $('.datatable' ).dataTable ( {
63+ $('.datatable' ).DataTable ( {
6464 "sDom ": " <'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>" ,
6565 " sPaginationType" : " bootstrap"
6666});
6767
6868// For fixed width containers
69- $('.datatable' ).dataTable ( {
69+ $('.datatable' ).DataTable ( {
7070 "sDom ": " <'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>" ,
7171 " sPaginationType" : " bootstrap"
7272});
@@ -91,7 +91,7 @@ $('.datatable').dataTable({
91914 - Initialize your datatables using these option :
9292
9393```javascript
94- $('.datatable' ).dataTable ( {
94+ $('.datatable' ).DataTable ( {
9595 // ajax : ...,
9696 // autoWidth: false,
9797 // pagingType: ' full_numbers' ,
@@ -123,57 +123,44 @@ $('.datatable').dataTable({
123123
124124## Responsive Installation
125125
126- ### If you are using the gem from master branch, bellow text it is invalid, please see http://www.datatables .net/extensions/responsive/init
127-
1281261 - Complete steps 1-3 of the General Installation.
129127
130- 2 - Add the lodash gem to your application:
131-
132- ```ruby
133- gem 'lodash-rails '
134- ```
135-
136- 3 - Add some more JavaScript to `application.js`:
128+ 2 - Add some more JavaScript to `application.js`:
137129
138130```javascript
139131//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
140132//= require dataTables/extras/dataTables.responsive
141133```
142134
143- 4 - Add this (and only this) stylesheet to `application.css`:
135+ 3 - Add this (and only this) stylesheet to `application.css`:
144136
145137```css
146138* = require dataTables/bootstrap/3/jquery.dataTables.bootstrap
147139* = require dataTables/extras/dataTables.responsive
148140```
149141
150- 5 - Initialize your datatables using:
142+ 4 - Initialize your datatables using:
151143
152144```coffeescript
153- responsiveHelper = undefined
154- breakpointDefinition =
155- tablet: 1024
156- phone: 480
145+ $("#example" ).DataTable
146+ responsive: true
147+ ```
157148
158- tableElement = $("#example" )
159- tableElement.dataTable
160- autoWidth: false
161- preDrawCallback: ->
149+ 5 - Add `responsive no-wrap ` class to html `table`,
162150
163- # Initialize the responsive datatables helper once.
164- responsiveHelper = new ResponsiveDatatablesHelper(tableElement, breakpointDefinition) unless responsiveHelper
165- return
151+ ````html
152+ <table class="display responsive no-wrap ">
153+ <thead >
154+ <tr >
166155
167- rowCallback: (nRow) ->
168- responsiveHelper.createExpandIcon nRow
169- return
156+ </tr >
157+ </thead >
158+ ...
159+ </table >
160+ ````
170161
171- drawCallback: (oSettings) ->
172- responsiveHelper.respond()
173- return
174- ```
162+ 6. More information at: http://www.datatables .net/extensions/responsive/init
175163
176- 6 - To use see the author of responsive files and follow the instructions as described on [datatables-responsive ]
177164
178165## Plugins
179166
@@ -204,8 +191,6 @@ FixedHeader : dataTables.fixedHeader
204191KeyTable : dataTables.keyTable
205192Scroller : dataTables.scroller
206193TableTools : dataTables.tableTools
207-
208- # Unofficial extra is available:
209194Responsive : dataTables.responsive
210195````
211196
@@ -231,10 +216,6 @@ Make sure to also add it's initialization as described on [datatables extras' si
231216
232217[ajax-datatables-rails ] a wrapper around datatable's ajax methods that allow synchronization with server-side .
233218
234- ## Thanks
235-
236- Thanks to Comanche for responsive support files [datatables-responsive ]
237-
238219[assets ]: app/assets/javascripts/dataTables
239220[datatables_extras ]: http://datatables.net/extras/
240221[datatables-responsive ]: https://github.com/Comanche/datatables-responsive
0 commit comments