DataTables - delete data tables from HTML tables created in another JavaScript file

So, I have a website that I visit every day to work. The DataTables implementation on this site is terrible. The DataTable is applied to the HTML table that is created when the page is rendered, and then the DataTable is initialized. I realized that this is great because I can create a little TamperMonkeyscript to remove the terrible DataTable and create one that functions the way I need it.

A DataTable is created using the built- Javascriptin document end body. I tried the following for DOCs for a method destory().

// ==UserScript==
// @name       
// @version    0.1
// @description  Makes the Invoice Table more user friendly
// @include      URL
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  http://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.1/js/jquery.dataTables.min.js

// @copyright  2014+, Me
// ==/UserScript==
$(function() {
   var t = $('#customer_invoices').DataTable();
   t.destroy();

});

" , , ", . , .

, , Datatable, DataTable .

, .

+4
2

.destroy().

, , , , :

$("#elementID").dataTable.destroy()

note: dataTable().destroy(), dataTable.

, , , destroy ... dataTable destroy..., (, b cd - ).

, , , dataTable... , , destroy() -, .

0

, , - div - . div .

0

All Articles