I'm trying to implement some column filtering with handsontable and I'm running into some problems. So far the filtering works well, the problem is when I'm trying to save. This is what I'm doing -
So based on the search terms, I loop through the rows and columns and push into a searchResults array.
if(data[row][colKey].toLowerCase().indexOf(searchTerm) > -1) {
searchResults.push(data[row]);
break;
}
Then I take these results and make this the new data source of the handsontable
$('#dataTable').handsontable({
colHeaders: columnHeaders,
columns: columnData,
data: searchResults
});
So now when the user sees the filtered results and tries to edit and save - the table saves just the filtered view rather than the entire table (because the filtered results is now the new datatable)
To get around this, my initial thought is to try to merge the original table data and the new changed searchResults. But before I dig into that I was wondering if anyone knows an easier way to do this?
$('#dataTable').handsontable({
colHeaders: columnHeaders,
columns: columnData,
data: original
});