Using Datatable functionality in vue.js component

Using Datatable functionality in vue.js component

Umair ChauhanUmair Chauhan Posts: 1Questions: 1Answers: 0
edited June 2 in DataTables

I am using laravel spark application. I want to use datatable draw function like this (
(#mytable).Datatable() ) in my vue.js component. But there is error that Datatable is not a function. i am using datatable through CDN.

Answers

  • colincolin Posts: 12,098Questions: 0Answers: 2,054

    If (#mytable) is supposed to to be jQuery selector, then it should be something like

    $('#mytable').DataTable()
    

    and then use draw(),

    Colin

  • allanallan Posts: 54,171Questions: 1Answers: 8,455 Site admin

    Also note the capital T in DataTable.

    Also worth noting is that I tend to use v-once on thr table to make sure that Vue and DataTables don't try to control the same DOM elements.

    Allan

Sign In or Register to comment.