[]
wijmo.grid.filter 모듈은 각 열에 Excel 스타일의 필터링 UI를 추가하는 FlexGridFilter 클래스를 제공합니다. FlexGridFilter는 두 가지 유형의 필터를 제공합니다: 값에 의한 필터 및 조건에 의한 필터
값 필터 편집기에는 사용자가 선택할 수 있는 고유한 값 목록이 포함되어 있습니다. 그리드에 많은 데이터가 포함된 경우, 이 고유 값 목록을 생성하는 데 시간이 걸릴 수 있습니다. 또한 목록에 너무 많은 값이 포함되어 있으면 그다지 유용하지 않습니다.(이 경우 조건 필터가 더 적합할 수 있습니다)
이 샘플은 값 필터를 최적화하는 3가지 방법을 보여줍니다:
import * as wjGrid from '@grapecity/wijmo.grid';
import * as wjGridFilter from '@grapecity/wijmo.grid.filter';
function init() {
// FlexGridFilter client-side filtering
var theGrid = new wjGrid.FlexGrid('#theGrid', {
itemsSource: data
});
var filter = new wjGridFilter.FlexGridFilter(theGrid);
// ratings are values from 0 to 5
var filterRating = filter.getColumnFilter('rating');
filterRating.valueFilter.uniqueValues = [0, 1, 2, 3, 4, 5];
// limit number of values shown in sales filter
var filterSales = filter.getColumnFilter('sales');
filterSales.valueFilter.maxValues = 20;
// filter expenses only by condition
var filterExpenses = filter.getColumnFilter('expenses');
filterExpenses.filterType = wjGridFilter.FilterType.Condition;
}