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

137
Vistas
tabEndNewRow copies first fow instead of using provided data

In my code I pass to tabEndNewRow an intial empty row object. When you go to jsFiddle and enter something to C2 column and hit tab key then

  • new row is inserted - correct
  • entered value is assigned to C2 column of new row - error

if you use function for tabEndNewRow then it works as expected. Did I get it wrong?

var cols = [
    { title: "Cell 1", field: "c1" },
    { title: "Cell 2", field: "c2", editor: "input" }
];
        
var row = {"c1":"","c2":""}

var table = new Tabulator('#table', {
    columns: cols,
    data: [row],
    height:"100%",
    tabEndNewRow: row,
});

Tabulator v5.0.8

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

0

In your JS Fiddle, you are passing the row object into both the data optionand the tabEndNewRow option.

Because objects are passed by reference, edits to the row data are then stored in that same object which is called when the new row is created, so it is populated by the new data.

In your example you need to break the reference by calling Object.assign when passing the row object to the tabEndNewRow prop:

tabEndNewRow:Object.assign({}, row);
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