hi all,
i use Editor Datatable when i select rows from datatable et use button editor all works fine all details from each selected rows are send.
Now i have created a extra button but when i follow the sames steps all workfine but all rows from datatable are send but not only selected rows.
Below the code
Standard button
editorcreateticket = new $.fn.dataTable.Editor( {
ajax : {
url: '/sgp/editor/fiche',
data: function(d) {
d.action = "ticket";
console.log("d: ",d);
},
},
table : '#tableSgp',
idSrc : 'id',
"events": '',
fields: [ {
label : 'Nom du ticket',
name : 'libelle',
optionsPair: {
value: 'id',
}
},
{
label: "Typologie",
name: "Typologie",
type: "select",
options: [
{ label: "", value: "VIDE" },
{ label: "Crée", value: "Crée" },
{ label: "Attribué", value: "Attribué" },
{ label: "En cours de traitement", value: "En cours de traitement" },
{ label: "Résolu", value: "Résolu" },
{ label: "Envoi en litige", value: "Envoi en litige" },
{ label: "Ecarts acceptés", value: "Ecarts acceptés" }
]
},
{
label : 'Commentaire',
name : 'commentaire',
// type : 'text',
},
{
label : 'Utilisateur',
name : 'users',
type : 'select',
multiEditable : true,
placeholder : 'Choisir un utilisateur'
}
} );
Extra Button
$('#ticketButton').on('click', function (e) {
e.preventDefault();
var resultat = selected();
console.log("resultat");
editorcreateticket
.title('<br><H2><span style="color: black; font-family: Reckless Neue;">Créer un ticket</span></H2><br>'+ resultat[0]["count"]+ ' Fiches séléctionnées ... <p><span style="color: black;">Créez un ticket à partir des écarts sélectionnés. Vous pouvez vous l’attribuer ou l’attribuer à un responsable. <div class="container"><p>Exactitude</p><div class="progressbar-wrapper"> <div title="downloaded" class="progressbar mp4">64%</div></div></span></p>')
.ajax({
url: '/sgp/editor/fiche',
data: function(d) {
d.action = "ticket";
console.log(d);
},
})
//.table('#tableSgp')
//.idSrc('id')
.buttons([
{
label: 'Annuler',
className: 'closeButton',
action: function () {
var that = this;
setTimeout(function() {
that.close();
}, 100);
}
},
{
label: 'Créer',
}])
.edit();
} );
Could you tell me how repoduce the same feature only send selected rows to the server ?
Thank you for your help
Michel