Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82435

Not able to do ajax.url().load() on multiple Tables

$
0
0
Hi,
i have two of the awesome Datatables:
                var table = $('#UserTable').DataTable( {
                    ajax: "/ajax/admin/getusertable/datatable",
                	"aoColumns": [
                              	{ "mData": "username"},
                              	{ "mData": "email"},
                              	{ "mData": "state"},
                              	{ "mData": "note"},
                              	{ "mData": "created_at"},
                              	{ "mData": "updated_at"},
                              	]
                } );

            	var historytable = $('#UserHistoryTable').DataTable( {
                	"aoColumns": [
                              	{ "mData": "key"},
                              	{ "mData": "old_value"},
                              	{ "mData": "new_value"},
                              	{ "mData": "user_id"},
                              	{ "mData": "updated_at"}
                              	]
                } );



This works fine. When i do some Updates, i want to reload the UserTable.
I do
table.ajax.reload();
this also works fine. But then i want to load the "historytable" with a new Datasource
historytable.ajax.url( "/ajax/getusrhstry/" + id ).load();
This results in error throwing
"DataTables warning: table id=UserTable - Requested unknown parameter 'username' for row 0."
and destroy my UserTable.

Seems like, it is trying to load the Data into the "UserTable" instead into the "UserHistoryTable" but i have no clue what is wrong with my code.

Viewing all articles
Browse latest Browse all 82435

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>