applyFilter(dataField) {
        this.refs.myDataTable.clearFilters();
        let filtertype = 'stringfilter';
        if (dataField == 'date') filtertype = 'datefilter';
        if (dataField == 'price' || dataField == 'quantity') filtertype = 'numericfilter';
        // create a new group of filters.
        let filtergroup = new $.jqx.filter();
        // get listbox's checked items.
        let checkedItems = this.refs.filterbox.getCheckedItems();
        if (checkedItems.length == 0) {
            let filter_or_operator = 1;
            let filtervalue = 'Empty';
            let filtercondition = 'equal';
            let filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
            filtergroup.addfilter(filter_or_operator, filter);
        }
        else {
            for (let i = 0; i < checkedItems.length; i++) {
                let filter_or_operator = 1;
                // set filter's value.
                let filtervalue = checkedItems[i].label;
                // set filter's condition.
                let filtercondition = 'equal';
                // create new filter.
                let filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
                // add the filter to the filter group.
                filtergroup.addfilter(filter_or_operator, filter);
            }
        }
        // add the filters.
        this.refs.myDataTable.addFilter(dataField, filtergroup);
        // apply the filters.
        this.refs.myDataTable.applyFilters();
    }
// builds and applies the filter.
builds and applies the filter.
builds and applies the filter .
applyFilter(dataField) {
        this.refs.myDataTable.clearFilters();
        let filtertype = 'stringfilter';
        if (dataField == 'date') filtertype = 'datefilter';
        if (dataField == 'price' || dataField == 'quantity') filtertype = 'numericfilter';
        let filtergroup = new $.jqx.filter();
        let checkedItems = this.refs.filterbox.getCheckedItems();
        if (checkedItems.length == 0) {
            let filter_or_operator = 1;
            let filtervalue = 'Empty';
            let filtercondition = 'equal';
            let filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
            filtergroup.addfilter(filter_or_operator, filter);
        }
        else {
            for (let i = 0; i < checkedItems.length; i++) {
                let filter_or_operator = 1;
                let filtervalue = checkedItems[i].label;
                let filtercondition = 'equal';
                let filter = filtergroup.createfilter(filtertype, filtervalue, filtercondition);
                filtergroup.addfilter(filter_or_operator, filter);
            }
        }
        this.refs.myDataTable.addFilter(dataField, filtergroup);
        this.refs.myDataTable.applyFilters();
    }
applyFilter ( dataField ) { this . refs . myDataTable . clearFilters ( ) ; let filtertype = 'stringfilter' ; if ( dataField == 'date' ) filtertype = 'datefilter' ; if ( dataField == 'price' || dataField == 'quantity' ) filtertype = 'numericfilter' ; let filtergroup = new $ . jqx . filter ( ) ; let checkedItems = this . refs . filterbox . getCheckedItems ( ) ; if ( checkedItems . length == 0 ) { let filter_or_operator = 1 ; let filtervalue = 'Empty' ; let filtercondition = 'equal' ; let filter = filtergroup . createfilter ( filtertype , filtervalue , filtercondition ) ; filtergroup . addfilter ( filter_or_operator , filter ) ; } else { for ( let i = 0 ; i < checkedItems . length ; i ++ ) { let filter_or_operator = 1 ; let filtervalue = checkedItems [ i ] . label ; let filtercondition = 'equal' ; let filter = filtergroup . createfilter ( filtertype , filtervalue , filtercondition ) ; filtergroup . addfilter ( filter_or_operator , filter ) ; } } this . refs . myDataTable . addFilter ( dataField , filtergroup ) ; this . refs . myDataTable . applyFilters ( ) ; }
builds and applies the filter.
builds and applies the filter .
// create a new group of filters. // get listbox's checked items. // set filter's value. // set filter's condition. // create new filter. // add the filter to the filter group. // add the filters. // apply the filters.