show the same table when page reload
show the same table when page reload
I got 2 datatables with ajax for example like :
function setDataTablel(tgl = null, tglA = null, tglB = null, departemenId = null, group = true, seperate = false, hariInterval = null, pisah = true, barangId = null, kodeMerk = null){
setColumn(group, seperate);
$('.tableCustom3').DataTable().destroy();
var columns = [];
columns.push(
{ data: 'DT_RowIndex', name: 'DT_RowIndex', orderable: false, searchable: false },
{ data: 'cabang', name: 'cabang' },
);
for(var count = 0; count < 31; count++){
columns.push(
{ data: count, name: count}
);
};
columns.push(
{ data: 'score', name: 'score' }
);
$('.tableCustom3').DataTable({
deferRender : true,
scrollX: "800px",
scrollY: "500px",
scrollCollapse: true,
paging: false,
processing: true,
serverSide: true,
fixedColumns: {
left: 0,
right: 1
},
ajax: {
url: "{{ route('scoreboard.index') }}",
type: "GET",
data: {
tglA: tglA,
tglB: tglB,
departemenId: departemenId,
group: group,
seperate: seperate,
pisah: pisah,
barangId: barangId,
kodeMerk: kodeMerk,
},
},
columns: columns
});
}
i got 2 datatables like that, so there 2 button on my page so based on what someone click it will show that table + data and if user click the other button it will add form-hidden
calss to the other one and remove form-hidden
class from the current one, now i what i want to do is when user reload via browser reload or f5
it will still show the same table, how can i do that ? it seems ajax.reload
doesnt do that only refresh the table
Replies
Sounds like you will want to use
stateSave
.Kevin