var columns = [ { data: "type_contact_statut_id", render: function (data, type, row) { if (row.type_contact_statut_id) { tpl = row.type_contact_statut.nom; } else { tpl = ''; } return tpl; } }, { data: "name", }, { data: "firstname", }, { data: "mobile", render: function (data, type, row) { tpl = ''; if (row.mobile) { tpl += 'Mobile : ' + row.mobile + '
'; } if (row.tel_perso) { tpl += 'Domicile : ' + row.phone + '
'; } if (row.tel_pro) { tpl += 'Pro : ' + row.phone_pro; } return tpl; } }, { data: "email", render: function (data) { return data; } }, { data: "zipcode", render: function (data, type, row) { return data; } }, { data: "city", render: function (data) { return data; } }, { data: "id", orderable: false, render: function (data, type, row) { tpl = " "; tpl += " "; return tpl; } }, ]; var model = "contact"; var route = "Contacts"; var options = { // order: [[ 2, 'asc' ]], fixedColumns: { leftColumns: 1, rightColumns: 1 }, // fixedColumns: false, // columnDefs: columnDefs, columns: columns, } var globals = []; globals['handlers'] = []; function populate() { } $(document).ready(function() { var Table = getDataTables(options,route,model); $(".search-input-text").off().on("change keyup", function(e) { Table.column( $(this).parent().index()+':visible' ).search( this.value ).draw(); }) $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); tpl = '   Création d\'un contact'; $('div.col-md-4.add').html(tpl); initModalAdmin(route,model,Table.ajax.reload,populate,Table); });