Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

129
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda