Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
Eliminar fila de la tabla usando el botón - Tabla Bootstrap

Estoy tratando de eliminar la fila cuando hago clic en el ícono de eliminar en la tabla usando la tabla de arranque.

Mi mesa:

 <table id="checkDataTable"> <thead style="color: #31708f; background-color: #d9edf7 "> <tr> <th data-field="AssetReference">Referans</th> <th data-field="Customer">Müsteri</th> <th data-field="ReceiverCompanyName">Alici Firma</th> <th data-field="Tools" data-formatter="StatuFormatter">Islem</th> </tr> </thead> </table>

JavaScript:

 function StatuFormatter(value, row, index) { return "<a onclick='removeAssetEconomyCheckBillOfLadingRow()'><i class='fa fa-trash fa-2x' aria-hidden='true'></i></a>"; } function removeAssetEconomyCheckBillOfLadingRow(id) { alert(id); }

Está bien hasta la función removeAssetEconomyCheckBillOfLadingRow.

¿Cómo puedo eliminar dentro de esta función?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Intente a continuación:

 $(document).on('click', 'button.deleteRow', function(event) { $(this).closest("tr").remove(); });
 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <table id="checkDataTable" class="table"> <thead style="color: #31708f; background-color: #d9edf7 "> <tr> <th data-field="AssetReference">Referans</th> <th data-field="Customer">Müşteri</th> <th data-field="ReceiverCompanyName">Alıcı Firma</th> <th data-field="Tools" data-formatter="StatuFormatter">İşlem</th> </tr> </thead> <tobdy> <tr> <td>Data1</td> <td>Data1</td> <td>Data1</td> <td><button type="button" class="deleteRow"> Delete </button></td> </tr> <tr> <td>Data2</td> <td>Data2</td> <td>Data2</td> <td><button type="button" class="deleteRow"> Delete </button></td> </tr> <tr> <td>Data3</td> <td>Data3</td> <td>Data3</td> <td><button type="button" class="deleteRow"> Delete </button></td> </tr> </tobdy> </table>

about 4 years ago · Juan Pablo Isaza Denunciar

0

  1. En primer lugar, debe configurar id para identificar la fila de eliminación.
 <tr id="1"></tr>
  1. Y obtener tr y eliminar
 function removeAssetEconomyCheckBillOfLadingRow(id) { $('#checkDataTable').row($('#{{id}}'))).remove().draw(); }
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda