I get a pop-up error when I load a page that is using table-trash:

DataTables warning (table id = 'DataTables_Table_0')
Cannot reinitialise DataTable

To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy

A different issue:
The copy, csv, excel buttons appear as empty white boxes. They work as buttons, but there is no indication as to their function until you click on them.

And finally, the sort doesn't work well with large numbers. 10 numbers between 1 and 1,000,000 appear to be randomly sorted regardless of ascending or descending order.

Comments

rdeboer’s picture

Hi AgentJay,
Not sure about these. Interference with other javascript on your system? If you change the theme to Bartik, do the problems persist?

The buttons require Flash.

Regarding the sorting... do the numbers have comma's? I know DataTables does its best in determining the data type (text, number, date), but it may not always succeed. So your numbers may be sorted alphabetically, so that 1,000,000 comes before 2.

Also the errors you see may be connected, in that an error at the top may cause javascript execution to abort, causing remaining functions not to execute. Check your browser console.

Finally, as Table Trash just passes control to DataTables JS, I suggest you check the issue queue over there and maybe create a trouble ticket: https://datatables.net/forums/discussions

Rik

milekium’s picture

I did have same error when adding a modal link inside a table.
I add the following code to table_trash.js and error go away. code from here

attach: function(context, settings) {
+if (typeof oTable == 'undefined') {
+			oTable = $('#commentstable').dataTable({
+				"bProcessing": true,
+				"bServerSide": true,
+				"iDisplayLength": 150,
+				"bLengthChange": false,
+				"sAjaxSource": "datatables_comments_list.php"
+			});
+		}
+		else
+		{
+			oTable.fnClearTable( 0 );
+			oTable.fnDraw();
+		}
rdeboer’s picture

First error may be related to #2173339: Exposed filter breaks everything, which is now fixed.

rdeboer’s picture

Status: Active » Closed (works as designed)

Sorting of numbers does not work well when these numbers have comma's for thousand separators. Please log an issue with the DataTables project for this.