Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!