title: How to get data of row from KTDatatable using jQuery
body: <p>I am trying to get the data of a row by clicking on a button within the same row.
  Checking the metronic documentation, there is an event that returns the entire dataset used to generate the table, but there is nothing that specifies the way to fetch the data from a single row. In the same documentation they indicate that a checkbox must be created, then select the checkbox to later make an attempt to search by the name of the columns. I already did it and it always returns an empty value</p>
  <p>my code is:</p>
  <pre><code>var KTDatatableRemoteAjaxDemo = function () {
      // Private functions
  
      // basic demo
      var demo = function () {
  
          var datatable = $('#kt_datatable').KTDatatable({
              // datasource definition
              data: {
                  type: 'remote',
                  source: {
                      read: {
                          url: 'Horarios/GetHorarios',
                          // sample custom headers
                          // headers: {'x-my-custom-header': 'some value', 'x-test-header': 'the value'},
                          map: function (raw) {
                              // sample data mapping
                              var dataSet = raw;
                              if (typeof raw.data !== 'undefined') {
                                  dataSet = raw.data;
                              }
                              return dataSet;
                          },
                      },
                  },
                  pageSize: 10,
                  serverPaging: true,
                  serverFiltering: false,
                  serverSorting: false,
              },
  
              // layout definition
              layout: {
                  scroll: false,
                  footer: false,
                  spinner: {
                      message: true,
                      message: &quot;CARGANDO DATOS&quot;
                  }
              },
              translate: {
                  records: {
                      processing: 'ESPERE POR FAVOR',
                      noRecords:'SIN REGISTROS PARA MOSTRAR'
                  },
                  toolbar: {
                      pagination: {
                          items: {
                              default: {
                                  first: 'Primero',
                                  prev: 'Anterior',
                                  next: 'Siguiente',
                                  last: 'Último',
                                  more: 'Más páginas',
                                  input: 'Número de página',
                                  select: 'Selecciona página1'
                              },
                              info: 'Mostrando {{start}} - {{end}} de {{total}} registros'
                          }
                      }
                  }
              },
  
              // column sorting
              sortable: true,
  
              pagination: true,
              detail: {
                  title: 'VER DIAS',
                  content: subTableInit,
              },
              
  
              // columns definition
              columns: [{
                  field: 'consecutivo',
                  title: '',
                  sortable: 'asc',
                  width: 50,
                  type: 'number',
                  selector: false,
                  textAlign: 'center',
              }, {
                      field: 'checkbox',
                      title: '',
                      template: '{{consecutivo}}',
                      sortable: false,
                      width: 20,
                      textAlign: 'center',
                      selector: { class: 'kt-checkbox--solid' },
                  },
              
                  {
                  field: 'fechaInicial',
                      title: 'FECHA INICIAL',
                      type: 'date',
                      format: 'MM/DD/YYYY',
                      textAlign: 'center',
                  },
                  {
                      field: 'fechaFinal',
                      title: 'FECHA FINAL',
                      type: 'date',
                      format: 'MM/DD/YYYY',
                      textAlign: 'center',
                  }, 
                  {
                      field: 'horaInicial',
                      title: 'HORA INICIAL',
                      textAlign: 'center',
                  },
                  {
                      field: 'horaFinal',
                      title: 'HORA FINAL',
                      textAlign: 'center',
                  }, 
                  {
                  field: 'status',
                  title: 'ESTATUS',
                      autoHide: false,
                      textAlign: 'center',
                  // callback function support for column rendering
                  template: function (row) {
                      var status = {
                          
                          1: {
                              'title': 'ACTIVO',
                              'class': ' label-light-success'
                          },                        
                          0: {
                              'title': 'INACTIVO',
                              'class': ' label-light-danger'
                          }
                      };
                      return '&lt;span class=&quot;label font-weight-bold label-lg ' + status[row.status].class + ' label-inline&quot;&gt;' + status[row.status].title + '&lt;/span&gt;';
                  },
                  },
                  {
                      field: '',
                      title: 'ACCIONES',
                      sortable: false,
                      overflow: 'visible',
                      autoHide: false,
                      
                      template: function () {
                          return '\&lt;a class=&quot;btn btn-sm btn-clean btn-icon mr-2&quot; id=&quot;editHorario&quot; title=&quot;Editar horario&quot;&gt;\
                                  &lt;span class=&quot;svg-icon svg-icon-md&quot;&gt;\
                                      &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;24px&quot; height=&quot;24px&quot; viewBox=&quot;0 0 24 24&quot; version=&quot;1.1&quot;&gt;\
                                          &lt;g stroke=&quot;none&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; fill-rule=&quot;evenodd&quot;&gt;\
                                              &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;24&quot; height=&quot;24&quot;/&gt;\
                                              &lt;path d=&quot;M8,17.9148182 L8,5.96685884 C8,5.56391781 8.16211443,5.17792052 8.44982609,4.89581508 L10.965708,2.42895648 C11.5426798,1.86322723 12.4640974,1.85620921 13.0496196,2.41308426 L15.5337377,4.77566479 C15.8314604,5.0588212 16,5.45170806 16,5.86258077 L16,17.9148182 C16,18.7432453 15.3284271,19.4148182 14.5,19.4148182 L9.5,19.4148182 C8.67157288,19.4148182 8,18.7432453 8,17.9148182 Z&quot; fill=&quot;#000000&quot; fill-rule=&quot;nonzero&quot;\ transform=&quot;translate(12.000000, 10.707409) rotate(-135.000000) translate(-12.000000, -10.707409) &quot;/&gt;\
                                              &lt;rect fill=&quot;#000000&quot; opacity=&quot;0.3&quot; x=&quot;5&quot; y=&quot;20&quot; width=&quot;15&quot; height=&quot;2&quot; rx=&quot;1&quot;/&gt;\
                                          &lt;/g&gt;\
                                      &lt;/svg&gt;\
                                  &lt;/span&gt;\
                              &lt;/a&gt;\
                          ';
                      },
                  },
              ],
  
          });
          
          
          //----------------------------------------------------------------------------------
  
          function subTableInit(e) {
              $('&lt;div/&gt;').attr('id', 'child_data_ajax_' + e.data.consecutivo).appendTo(e.detailCell).KTDatatable({
                  data: {
                      type: 'remote',
                      source: {
                          read: {
                              url: '/Horarios/GetDias',
                              params: {
                                  // custom query params
                                  consecutivo: e.data.consecutivo
                              },
                          },
                      },
                      
                  },
                  pagination:false,
                  // layout definition
                  layout: {
                      scroll: false,
                      footer: false,
  
                      // enable/disable datatable spinner.
                      spinner: {
                          type: 1,
                          theme: 'default',
                          message: true,
                          message:'CARGANDO DIAS'
                      },
                  },
  
                  sortable: false,
  
                  // columns definition
                  columns: [
                       {
                          field: 'dia',
                          title: 'Dias',
                          textAlign: 'center',
                          template: function (row) {
                              var dia = {
  
                                  1: {
                                      'title': 'LUNES',
                                      'class': ' label-light-primary'
                                  },
                                  2: {
                                      'title': 'MARTES',
                                      'class': ' label-light-success'
                                  },
                                  3: {
                                      'title': 'MIÉRCOLES',
                                      'class': ' label-light-info'
                                  },
                                  4: {
                                      'title': 'JUEVES',
                                      'class': ' label-light-warning'
                                  },
                                  5: {
                                      'title': 'VIERNES',
                                      'class': ' label-light-danger'
                                  }
  
                              };
  
  
  
                              return '&lt;span class=&quot;label font-weight-bold label-lg ' + dia[row.dia].class + ' label-inline&quot;&gt;' + dia[row.dia].title + '&lt;/span&gt;';
                          },
                      }, {
                          field: 'totalAudienciasJunta',
                          title: 'TOTAL AUDIENCIAS DE LA JUNTA',
                          textAlign: 'center',
                          
                      }, {
                          field: 'totalAudienciasRadicaciones',
                          title: 'TOTAL AUDIENCIAS DE RADICACIONES',
                          textAlign: 'center',
                      },
                      
                      {
                          field: '',
                          width: 125,
                          title: 'ACCIONES',
                          sortable: false,
                          overflow: 'visible',
                          autoHide: false,
                          template: function () {
                              return '\&lt;a href=&quot;javascript:;&quot; class=&quot;btn btn-sm btn-clean btn-icon mr-2&quot; title=&quot;Editar día&quot;&gt;\
                                  &lt;span class=&quot;svg-icon svg-icon-md&quot;&gt;\
                                      &lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot; width=&quot;24px&quot; height=&quot;24px&quot; viewBox=&quot;0 0 24 24&quot; version=&quot;1.1&quot;&gt;\
                                          &lt;g stroke=&quot;none&quot; stroke-width=&quot;1&quot; fill=&quot;none&quot; fill-rule=&quot;evenodd&quot;&gt;\
                                              &lt;rect x=&quot;0&quot; y=&quot;0&quot; width=&quot;24&quot; height=&quot;24&quot;/&gt;\
                                              &lt;path d=&quot;M8,17.9148182 L8,5.96685884 C8,5.56391781 8.16211443,5.17792052 8.44982609,4.89581508 L10.965708,2.42895648 C11.5426798,1.86322723 12.4640974,1.85620921 13.0496196,2.41308426 L15.5337377,4.77566479 C15.8314604,5.0588212 16,5.45170806 16,5.86258077 L16,17.9148182 C16,18.7432453 15.3284271,19.4148182 14.5,19.4148182 L9.5,19.4148182 C8.67157288,19.4148182 8,18.7432453 8,17.9148182 Z&quot; fill=&quot;#000000&quot; fill-rule=&quot;nonzero&quot;\ transform=&quot;translate(12.000000, 10.707409) rotate(-135.000000) translate(-12.000000, -10.707409) &quot;/&gt;\
                                              &lt;rect fill=&quot;#000000&quot; opacity=&quot;0.3&quot; x=&quot;5&quot; y=&quot;20&quot; width=&quot;15&quot; height=&quot;2&quot; rx=&quot;1&quot;/&gt;\
                                          &lt;/g&gt;\
                                      &lt;/svg&gt;\
                                  &lt;/span&gt;\
                              &lt;/a&gt;\
                          ';
                          },
                      },],
              });
          }
      };
  
      return {
          // public functions
          init: function () {
              demo();
          },
      };
  }();
  
  $('#kt_datatable').on('click', 'tbody tr #editHorario', function (e) {
      var row = $('#kt_datatable').KTDatatable().row($(this).parents('tr').data());
  
      
  });
  </code></pre>