DataTables functionality only works when table is blank...?

DataTables functionality only works when table is blank...?

drichards2013drichards2013 Posts: 2Questions: 0Answers: 0
edited January 2014 in General
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]

Replies

  • drichards2013drichards2013 Posts: 2Questions: 0Answers: 0
    The functionality I'm talking about are the pagination, sorting, and searching features. Those all break when the table has at least one entry in it.
This discussion has been closed.