Domanda

I am using the Footable plug-in.It shows an error in console: "TypeError: Cannot read property 'sort' of undefined".

I have used following steps,

  1. Added gem 'footable-rails' in GemFile

  2. In Application.css:

     *= require_self
     *= require datepicker
     *= require datetimepicker
     *= require dataTables/jquery.dataTables.bootstrap
     *= require DT_bootstrap
     *= require bootstrap-wysihtml5
     *= require jquery.ui.datepicker
     *= require jquery.timepicker
     *= require footable-rails
     *= require_tree .
    
  3. Application.js:

    //= require jquery
    //= require jquery_ujs
    //= require jquery.ui.datepicker
    //= require twitter/bootstrap
    //= require bootstrap-datepicker
    //= require bootstrap-datetimepicker
    //= require dataTables/jquery.dataTables
    //= require dataTables/jquery.dataTables.bootstrap
    //= require jquery.timepicker.js
    //= require rails.validations
    //= require rails.validations.custom
    //= require rails.validations.simple_form
    //= require bootstrap-wysihtml5
    //= require highcharts
    //= require exporting
    //= require footable-rails
    //= require_tree .
    

What am I doing wrong?

È stato utile?

Soluzione

I was getting this same error, and it was because I had multiple footables on the same page, and basically the second table was overwriting the first table. So the reason I was getting the error is because I was trying to sort on a columnindex that didn't exist in the second table.

Anyway, I reported it as a bug https://github.com/bradvin/FooTable/issues/132, and it has been fixed, so if your having the same issue that I was having, re-download V2 and that should fix it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top