441
| <![CDATA[<script>
$(document).ready(function () {
var dt = $('#datatable').DataTable({
"processing": true,
"stateSave": true,
"serverSide": true,
"scrollX": true,
"language": {"url": 'https://cdn.datatables.net/plug-ins/1.10.19/i18n/Portuguese-Brasil.json'},
"ajax": {
url: "https://itambacuri.mg.gov.br/legislacoes/get/11",
dataSrc: function ( data ) {
last_update = data.last_update;
return data.data;
}
},
"columns": [
{"data": "numero"},
{"data": "ano"},
{"data": "titulo"},
{"data": "ementa", class: "text_table"},
{"data": "action", name: "action", orderable: false, searchable: false, class: "text-center"},
],
"footerCallback": function ( row, data, start, end, display ) {
let api = this.api()
$(api.column(2).footer()).html(
`Última atualização: ${last_update}`
);
},
"dom": 'Bfrtip',
"buttons": [
{
extend:'excelHtml5',
text: 'Excel',
action: function ( e, dt, node, config ) {
let url ='https://itambacuri.mg.gov.br/legislacoes/export?format=xlsx&tipo=11'
window.open(url);
}
},
{
extend:'excelHtml5',
text: 'ODS',
action: function ( e, dt, node, config ) {
let url ='https://itambacuri.mg.gov.br/legislacoes/export?format=ods&tipo=11'
window.open(url);
}
},
{
extend: 'csvHtml5',
action: function ( e, dt, node, config ) {
let url ='https://itambacuri.mg.gov.br/legislacoes/export?format=csv&tipo=11'
window.open(url);
}
},
]
});
});
</script>]]>
|