How to obtain the id of delete button?

How to obtain the id of delete button?

giulichajarigiulichajari Posts: 19Questions: 8Answers: 0

I'm creating a DataTable like that:

         t = $('#nuevoart').DataTable({

         data:q,

          columnDefs: [
               { type: 'currency', targets:3}
             ],

           columns: [
            {title: "ID",data:"details.id"},
            {title: "COD.:",data:"details.cod"},
            {title: "NOMBRE" ,data:"details.nombre"},
             {title: "MARCA" ,data:"details.marca"},
            {"title": "P/U ($)" ,data:"details.precio" },
          {title: "CAT.:" ,data:"details.cat"},
           {title: "SUBCAT.:" ,data:"details.subcat"},
             {title:"IVA (%)",data:"details.iva"},
            {  title:"ACCION",
                        data: null,
               className: "center",
                    defaultContent: '<button type="button"  class="editor_remove"><span class="fa fa-ok"></span><span 
        class="hidden-xs"> ELIMINAR</span></button>'
             }
          ], 

But i don't know how to assign for example details.id to the button id in order tu recognize what record is about. I'm working with php session to conservate the records.
I was trying it, because i have an autonumeric cod at the first colum(inline deleting).
var idregistro= $(this).parents("td:first").text();

This question has an accepted answers - jump to answer

Answers

This discussion has been closed.