Hi, i am initiating data table on onclick of table column values,there iam calling one service from that service output iam forming data set and setting it to data table.
If u click on one column value for the first time it is showing some data related to that row,But after that iam clicking on another row in that column only it is showing previous data set.Data table is not getting refreshed with fresh data.Iam using function to refresh data table,but it is not working.If iam not putting this line "retrieve: true," it is showing error like cannot reinitialize data table.
How can i refresh with new data set values??
- $('#attachmenttable').DataTable( {
- retrieve: true,
- paging: false,
- searching:false,
- data: combinedarray,
- columns: [
- { title: "File Name",visible:true,"render": function ( data, type, row ) {
- return '<a href="javascript:void(0)" onclick="opendetails('+"'"+row[1]+"'"+",'"+row[0]+"'"+')">' + data + '</a>';
- }},
- { title: "Base64",visible:false }
- ]
- } );
-
- function refreshTable() {
- $('#dataTables-attachmenttable').DataTable({
- responsive: true,
- "paging": false,
- "info": false,
- "searching" : false,
- "order": [[ 1, "desc" ]]
- });}
-
- setInterval(refreshTable , 1000 );