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.
TamperMonkey
A DataTable is created using the built- Javascriptin document end body. I tried the following for DOCs for a method destory().
Javascript
body
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 .
, .
.destroy().
.destroy()
, , , , :
$("#elementID").dataTable.destroy()
note: dataTable().destroy(), dataTable.
dataTable().destroy()
, , , destroy ... dataTable destroy..., (, b cd - ).
destroy
, , , dataTable... , , destroy() -, .
destroy()
, , - div - . div .