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

185
Views
Display all data before filtering using javascript, kendo and mysql

I have a select option that the purpose is to filter the division of the user, in my current code the data will show if the user start selecting a list of data inside the select option. This is my question, how to show first the all data and if the user start selecting an option it will filter. what i want is to show first all data.

const _data = {
   getColumnChartData: () =>{
       return new Promise((resolve, reject) => {
           var _division = $filterDivision && $filterDivision.val() != '' ? $filterDivision.val() : null;
           _division = typeof _division == 'string' ? [_division] : _division;      

           let query = `Select id, name, address FROM People WHERE divisionid in (` + _division `)`

        ....
       }
   }
}

const _ui = {
    $filterDivision
    .kendoMultiSelect({
    placeholder: 'Division',
    change: function (e) {
          _ui.widget.updateAll();
    },}).data('kendoMultiSelect').value([]);

}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can't just concat an array into a string, you need to do something like:

let query = "Select id, name, address FROM People WHERE divisionid in ('" + _division.join("','") + "')"

Demo:

let _division = [1,2,3,4];

let query = "Select id, name, address FROM People WHERE divisionid in ('" + _division.join("','") + "')";

console.log(query);

about 4 years ago · Santiago Trujillo 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!