[]
        
(Showing Draft Content)

FlexGrid 데이터 필터

그리드의 collectionView.filter 속성을 직접 사용할 수 있습니다. 이것은 수행하기 쉽고 매우 유연하지만, 필터 UI를 직접 구현해야 합니다.

예를 들어 이 그리드를 사용하면 국가별로 데이터를 필터링할 수 있습니다:

// 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
    }
});