(Showing Draft Content)

Filter FlexGrid Data

You can use the grid's collectionView.filter property directly. This is easy to do and very flexible, but you have to implement the filter UI yourself.

For example, this grid allows you to filter the data by country:

// create grid
var theGrid = new wijmo.grid.FlexGrid('#theGrid', {
    itemsSource: data,
// update grid filter when filter textbox changes
document.getElementById('filter').addEventListener('input', function(e) {
    var filter = e.target.value.toLowerCase();
    theGrid.collectionView.filter = function(item) {
        return filter.length == 0 || item.country.toLowerCase().indexOf(filter) > -1