'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([]);

}


Solution 1:[1]

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);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DontVoteMeDown