rweng / jquery-datatables-rails

jquery-datatables gem for rails
MIT License
564 stars 338 forks source link

Not applying to table #125

Closed jetian closed 10 years ago

jetian commented 10 years ago

Hi, Maybe you can quickly look to see what seem to be wrong?

    Rails v4.1.1
    jquery-datatables-rails (2.2.3)

Gemfile.lock:

    remote: git://github.com/rweng/jquery-datatables-rails.git
    revision: dfeab6e
    specs:
    jquery-datatables-rails (2.2.3)
    jquery-rails
    sass-rails

application.js

    //= require jquery
    //= require jquery_ujs
    //= require dataTables/jquery.dataTables
    //= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
    //= require bootstrap-sprockets
    //= require turbolinks
    //= require_tree .

application.css.scss

    @import "bootstrap-sprockets";
    @import "bootstrap";
    @import "dataTables/bootstrap/3/jquery.dataTables.bootstrap.css.scss";

project.js

    // Place all the behaviors and hooks related to the matching controller here.
    // All this logic will automatically be available in application.js.

    $(document).ready( function () {
    $('#projects').dataTable();
    } );`

Table has <tbody> and <thead>

Browser console shows the following error:

    TypeError: col is undefined
    if ( col.mData === i ) {
    jquery....?body=1 (line 6271)`

Please let me know if you need more information.

Thank you.

ricardodovalle commented 10 years ago

Hi @jetian
Did you solve? If yes, could you tell where it is the issue? Thanks.

jetian commented 10 years ago

Yes, it was a silly mistake. I had colspan in my header which was auto generated by Rails.

It's now working!