Ajout paramètre saveState dans instanciation DataTable

This commit is contained in:
Caribana 2018-05-01 14:45:25 +02:00
parent d776be73fc
commit 43d11b2fb7

View File

@ -278,7 +278,6 @@ if ($mysqli->connect_errno) {
function format ( row ) {
var d = $.parseJSON(row).data[0];
// `d` is the original data object for the row
console.log(d);
var ret = '<table cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
'<tr>'+
'<td>Commande pour:</td>'+
@ -325,7 +324,8 @@ console.log(d);
}
$(document).ready(function(){
var table = $('#example').DataTable( {
var table = $('#example')
.DataTable( {
"language": {
"sInfoEmpty": "Il n'y a rien à montrer...",
"sEmptyTable": "Tu n'as pas encore de demandes enregistrées...",
@ -339,6 +339,8 @@ $(document).ready(function(){
},
"search": "Rechercher"
},
stateSave: true,
"ajax": 'ajax/data/arrays',
"columns": [
{ "data": "mid" },
@ -380,6 +382,7 @@ $(document).ready(function(){
);
$('#identification').on('click', function() {
$('#uid').toggle();
table.page( 5 ).draw( false );
});
// Add event listener for opening and closing details
@ -403,7 +406,6 @@ $(document).ready(function(){
});;
} );
// Add event listener for editing entries
$('#example tbody').on('click', 'td.bck-edit', function () {
var tr = $(this).closest('tr');