disable/enable table select
disable/enable table select
hi i am using an edititable datatable with 2 butons (edit data, and lock in)
i want when i select an element in the table the press the buton select
the table become non editable and the select buton(lock in) become lock out
i tried many combination but didnt work
any idea or help please
what should i add to this code please
{
(function($){
$(document).ready(function() {
var editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.client.php',
table: '#client',
fields: [
{
"label": "Nom",
"name": "Nom"
},
{
"label": "Prenom",
"name": "Prenom"
},
{
"label": "Societe",
"name": "Societe"
},
{
"label": "Email",
"name": "Email"
},
{
"label": "Telephone",
"name": "Telephone"
},
{
"label": "Fax",
"name": "Fax"
},
{
"label": "Adresse",
"name": "Adresse"
},
{
"label": "Date",
"name": "Date"
},
{
"label": "Createdby",
"name": "Createdby"
}
]
} );
var table = $('#client').DataTable( {
dom: 'Bfrtip',
ajax: 'php/table.client.php',
columns:
[
{
"data": "Nom"
},
{
"data": "Prenom"
},
{
"data": "Societe"
},
{
"data": "Email"
},
{
"data": "Telephone"
},
{
"data": "Fax"
},
{
"data": "Adresse"
},
{
"data": "Date"
},
{
"data": "Createdby"
}
],
select: true,
lengthChange: false,
buttons:
[
{ extend: 'edit', editor: editor },
{
extend: "selectedSingle",
text: "Lock in",
action: function ( )
{
}
},
]
}
);
} );
}(jQuery));
}
Answers
Is this possible or not?
Any one please can help me
any one please
any help
i think once the table is initiliazed this option cant be modified
so i tested
table.destroy();
then recreate the table and set
select:false
its working for the moment but its kinda silly
why cant i change this methode once the table is intilialized
....
still waiting for any help