Posted 31 January 2018, 11:33 pm EST
This happens because the detail grids in the sample are using collection views that are already filtered.
Here’s the code that gets the products for a given category in the sample:
// get products for a given category
var products = {};
$scope.getProducts = function (categoryID) {
var view = products[categoryID];
if (!view) {
view = new wijmo.collections.CollectionView($scope.products.sourceCollection);
view.filter = function (item) {
return item.CategoryID == categoryID;
}
products[categoryID] = view;
}
return view;
}
Because the filter is already set, the FlexGridFilter class cannot apply its own filter and therefore doesn’t work.
You can fix this by changing the code that creates the detail grid a little bit. Instead of binding it directly to the product CollectionView (which is already filtered), bind it to the view’s items property instead. This will cause the grid to create a new CollectionView which can be filtered independently by the FlexGridFilter.
Here’s the fix:
var detailGrid = new wijmo.grid.FlexGrid(cell, {
headersVisibility: 'Column',
autoGenerateColumns: false,
// get the filtered items so the detail grid will
// have its own CollectionView, which can then be
// filtered independently
itemsSource: $scope.getProducts(row.dataItem.CategoryID).[b]items[/b],
isReadOnly: true,
columns: [
...
Hope this helps…