Change title of export table, everytime I change dropdown in HTML
Change title of export table, everytime I change dropdown in HTML

So I want to change the title of table when I export, the title is changed everytime I change a dropdown in HTML. For more clear this is my code:
in HTML :
<select id="filter-cabang-saldo-atm" >
<option>....</option>
<option>....</option>
<option>....</option>
</select>
in Script:
var tb_saldo_atm = $("#tb_saldo_atm").DataTable({
"scrollX": true,"scrollCollapse": true,
"columnDefs": [ {
"searchable": false,
"orderable": false,
"targets": 0
} ],"order": [[ 3, 'asc' ]],
"autoWidth": true,
"lengthMenu": [[20, 50, 100, -1], [20, 50, 100, "All"]],
dom: 'lBfrtip',
buttons: [{extend: 'print',footer:true,
text: 'Print',title:$("#judul_tabel_export").val()+' - '+$("#waktu_export").val()+$("#filter-cabang-saldo-atm option:selected").text(),
exportOptions: {
columns: [0,1,2,3,5],
modifier: {
selected: true
}
}}
}}
]
});
$('#filter-cabang-saldo-atm').on('change', function(){
tb_saldo_atm.column(5).search(this.value).draw();
tb_saldo_atm.rows().invalidate('dom');
});
Please help. Thanks before.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This thread should help, it's asking the same thing.
Cheers,
Colin
I have found the answer it should be use function.