Datatable not working when I am using settimeout function?
Datatable not working when I am using settimeout function?
adityasw
Posts: 3Questions: 1Answers: 0
Features like search, sort, pagination, mobile responsive not working. I'm using bootstrap 3, jquery datatable version - 1.10.10
Product Name | ASIN | Image | Reimburse | Total Units | Total Sales | Profit |
---|---|---|---|---|---|---|
SW20 16GB memory | B0245448898 | -- | -- | $30.00 | $13.00 | |
Scinex Bluetooth headset | B0000089451 | -- | -- | $7.00 | $3.00 | |
SW30 | B0245448898 | Refund | -- | $39.00 | $0.00 |
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
My guess is you are updating the HTML table without using Datatables APIs so its not updating its data cache which is what searching, sorting, etc use. Its not clear to me exactly what you are doing but you probably will need to use one of the Datatables invalidate methods like
rows().invalidate()
.Kevin
Thanks for you response Kevin. But, I have still not got the solution. Maybe that I explained it completely. Please refer to this page - https://www.scinex.com/cnp/dashboard.html
and table view.
https://datatables.net/forums/uploads/editor/19/2z1we282i4tx.png
I am using datables for the first time. and my idea is to bring table's data by ajax that's why 3 second delay in javascipt. Please help
Hi @adityasw ,
The table isn't being initialised - I did it, as in this screen shots, and all good. You just need to do that in your code.
Cheers,
Colin
Thanks Colin! It worked!!!!
adding following lines worked -
setTimeout(function(){
$('#data-table').DataTable( {
responsive: true
} );
}, 5000);