I'm trying to implement a column filter within a SlickGrid. I'm leveraging concepts from this header row sample (the sample itself might be a bit out of date since it's still using the Slick.Grid notation, but this was the closest I could find). When the grid simply uses the raw data, the data will render just fine in the grid. However, when I try to use the SlickDataView object, then data no longer shows up in the grid. Here are some code extracts:
import { Column, DataViewOption, SlickDataView, SlickGrid } from 'slickgrid';
The following code loads the grid, the line which creates the grid object will work when using testData, but fails when using dataView.
var gridOptions = {
enableCellNavigation: true,
enableColumnReorder: false,
showHeaderRow: true,
headerRowHeight: 30,
explicitInitialization: true
};
var dataViewOption: DataViewOption = {
groupItemMetadataProvider: null,
inlineFilters: false
}
var columns = [];
var columnFilters = [];
var dataView = new SlickDataView(dataViewOption);
//the following line works:
var testGrid = new SlickGrid('#testGrid', testData, this.getColumns(), gridOptions);
//the following line fails:
//var testGrid = new SlickGrid('#testGrid', dataView, this.getColumns(), gridOptions);
testGrid.init();
dataView.beginUpdate();
dataView.setItems(testData);
dataView.endUpdate();