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

157
Visualizações
Error getting row of data from DataTable when searching

I'm having trouble getting the following code to work. I have a table and wish to search the table for some data and return the row of data/array with the matching string (field13a). When running the code I get the following error:

outputReferenceError: filteredData is not defined

I have no idea what "filteredData" is

Code:

var field13a = field13.substring(0, 4); 
var indexes = locTable
    .rows()
    .indexes()
    .filter(function (value, index) {
        return field13a === locTable.row(value).data()[0];
    });

console.log(locTable.rows(indexes).data().toArray());

Not sure where I am going wrong, I have looked on Internet but not had any luck finding the best way to fix this or a better solution. Thank you.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Not sure what the error was but ended up using this:

var names = locTable
    .rows(function ( idx, data, node ) {
        return data[1] === field13a ?true:false;
    } )
    .data();
console.log(names[0]);
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