DataTables functionality only works when table is blank...?
DataTables functionality only works when table is blank...?
drichards2013
Posts: 2Questions: 0Answers: 0
When a table has 0 entries in it, the new sorting, paginating, and searching features work correctly. I've been working at this for hours. How do I get that functionality with a non-blank table?
imgur.com/A6kY1.png
But when there are entries in the table, all of that stops working:
imgur.com/lCL0g.png
The little sorting arrows appear, but they don't do anything when clicked.
Here's how I installed the gem:
application.js
[code]
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap3
$('.datatable').dataTable({
"sPaginationType": "bootstrap"
});
[/code]
application.css
[code]
*= require dataTables/jquery.dataTables.bootstrap3
[/code]
gemfile
[code]
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'will_paginate'
[/code]
the table looks like this in the view:
[code]
bla bla
bla bla
[/code]
imgur.com/A6kY1.png
But when there are entries in the table, all of that stops working:
imgur.com/lCL0g.png
The little sorting arrows appear, but they don't do anything when clicked.
Here's how I installed the gem:
application.js
[code]
//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap3
$('.datatable').dataTable({
"sPaginationType": "bootstrap"
});
[/code]
application.css
[code]
*= require dataTables/jquery.dataTables.bootstrap3
[/code]
gemfile
[code]
gem 'jquery-datatables-rails', git: 'git://github.com/rweng/jquery-datatables-rails.git'
gem 'will_paginate'
[/code]
the table looks like this in the view:
[code]
bla bla
bla bla
[/code]
This discussion has been closed.
Replies