Skip to content

Commit ae8dc99

Browse files
author
Nicolas Rodriguez
committed
Update README [ci skip]
1 parent bd41115 commit ae8dc99

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

README.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,20 @@ for this gem. If you'd be interested in contributing to speed development,
4343
please [open an issue](https://github.com/antillas21/ajax-datatables-rails/issues/new)
4444
and get in touch.
4545

46+
47+
## Breaking changes
48+
49+
**Warning:** the v0.4 version is a **major break** from v0.3. The core has been rewriten to remove dependency on Kaminari (or WillPaginate).
50+
51+
It also brings a new (more natural) way of defining columns, based on hash definitions (and not arrays) and add some filtering options for column search. [See below](#customize-the-generated-datatables-class) for more infos.
52+
53+
To migrate on the v0.4 you'll need to :
54+
55+
* update your DataTables classes to remove all the `extend` directives
56+
* switch to hash definitions of `view_columns`
57+
* update your views to declare your columns bindings ([See here](#wire-up-the-javascript))
58+
59+
4660
## Installation
4761

4862
Add these lines to your application's Gemfile:
@@ -385,10 +399,9 @@ $ ->
385399
ajax: $('#users-table').data('source')
386400
pagingType: 'full_numbers'
387401
columns: [
388-
{data: 'id'}
389-
{data: 'name'}
390-
{data: 'phone'}
391-
{data: 'address'}
402+
{data: 'first_name'}
403+
{data: 'last_name'}
404+
{data: 'bio'}
392405
]
393406
# pagingType is optional, if you want full pagination controls.
394407
# Check dataTables documentation to learn more about
@@ -406,10 +419,9 @@ jQuery(document).ready(function() {
406419
"ajax": $('#users-table').data('source'),
407420
"pagingType": "full_numbers",
408421
"columns": [
409-
{"data": "id"},
410-
{"data": "name"},
411-
{"data": "phone"},
412-
{"data": "address"}
422+
{"data": "first_name"},
423+
{"data": "last_name"},
424+
{"data": "bio"}
413425
]
414426
// pagingType is optional, if you want full pagination controls.
415427
// Check dataTables documentation to learn more about

0 commit comments

Comments
 (0)