Global filter in handsontable

Tags: #<Tag:0x00007f8b18e2e8e8>

I am able to filter data globally on table i.e. On click on a search box, the table only renders the rows that contains the text that i entered.
But when the data entered is not found in table, it should show no rows with header, but even the header is getting removed. Below is the snippet for the same(using handsontable with angular ):

searchValue($event) {
const instance = this.hotRegisterer.getInstance(this.hotId);
var row, col, r_len, c_len;
var data = this.dataset;
var array = [];
for (row = 0, r_len = data.length; row < r_len; row++) {
for (col = 0, c_len = data[row].length; col < c_len; col++) {
if ((’’ + data[row][col]).toLowerCase().indexOf($event.target.value) > -1) {
array.push(data[row]);
break;
}
}
}
instance.loadData(array);
}

Hey @shradhag510

could you create a full example? Here’s a Handsontable for Angular demo that you can use as a base https://stackblitz.com/edit/angular-fmhnbi?file=src/app/hello.component.ts