Coder Social home page Coder Social logo

Comments (7)

utkarshrai003 avatar utkarshrai003 commented on July 17, 2024 18

I solved it. The Issue was jQuery was being initialised twice. Once before requiring the datatable and once after it was initialised and all set to work. So it was something like this.

//= require jquery
//= require jquery_ujs
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require tree.

And in the javascript directory, somehow an extra jquery.min.js file was there. So when //= require tree . was executed, Jquery was reinitialized once more and lost all the references to datatables.

Hope this may be useful for someone.

from jquery-datatables-rails.

Shwetakale avatar Shwetakale commented on July 17, 2024

Could you paste content of your application.js file here. It seems to be datatable is not loaded.

from jquery-datatables-rails.

stilney avatar stilney commented on July 17, 2024

This is my application.js file

//= require jquery
//= require jquery_ujs
//= require dataTables/jquery.dataTables
//= require dataTables/bootstrap/3/jquery.dataTables.bootstrap
//= require_tree .

from jquery-datatables-rails.

MichaelDorkhom avatar MichaelDorkhom commented on July 17, 2024

Any fix? I'm having the same issue

from jquery-datatables-rails.

Shwetakale avatar Shwetakale commented on July 17, 2024

@stilney @MichaelDorkhom It seems to be ok. I have similar configuration and it is working properly. Can you please check jquery console and see if there is any error before this or can you push sample application to reproduce this error?

from jquery-datatables-rails.

utkarshrai003 avatar utkarshrai003 commented on July 17, 2024

I am also facing the same Issue while calling dataTable(). Also, I have checked properly that Jquery is loaded priorily. The error is ->

Uncaught TypeError: $(...).dataTable is not a function(…)

@stilney Were you able to find a workaround for this ?

from jquery-datatables-rails.

Divyakalai avatar Divyakalai commented on July 17, 2024

jquery.min.js:2 jQuery.Deferred exception: $(...).DataTable is not a function TypeError: $(...).DataTable is not a function
at HTMLDocument. (http://localhost/Newtheme/clients/clientlist:1012:20)
at l (http://localhost/Newtheme/assets/theme/plugins/jquery/jquery.min.js:2:29375)
at c (http://localhost/Newtheme/assets/theme/plugins/jquery/jquery.min.js:2:29677) undefined
w.Deferred.exceptionHook @ jquery.min.js:2
jquery.min.js:2 Uncaught TypeError: $(...).DataTable is not a function
at HTMLDocument. (clientlist:1012)
at l (jquery.min.js:2)
at c (jquery.min.js:2)

.DataTable is not a function TypeError: $(...).DataTable is not a function

admin lte 3 datatable not working for me... any one pls help me

from jquery-datatables-rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.