AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.23k stars 782 forks source link

handleFilter & applyFilter do not exist? #2017

Closed Taerarenai closed 4 years ago

Taerarenai commented 6 years ago

I'm trying to create a custom filter for my table, however i cant even compile as it shows applyFilter does not exist.

Any tip on what i'm doing wrong?

  export class CalendarTable extends React.Component<SPListProps, CalendarItemsState>{

    constructor(props) {
      super(props);
      this.state = { isUpdated: false, wwlCalendar: [] };
    }

    componentDidMount() {
      getAllLists()
      .then(items => this.setState({ wwlCalendar }));

    }

    handleBtnClick = () => {
      this.refs.titleCol.applyFilter('Item name 3')
    }

    public render() {
      return (
        <BootstrapTable ref='table' data={wwlCalendar} version='4' pagination>
          <TableHeaderColumn columnClassName='hiddenTable' className='hiddenTable' dataField='UniqueID' isKey={true} >Unique ID</TableHeaderColumn>
          <TableHeaderColumn ref='titleCol' dataField='Title' filter={ { type: 'TextFilter', delay: 1000 } } >Title</TableHeaderColumn>
          <TableHeaderColumn dataField='Audience'>Audience</TableHeaderColumn>
          <TableHeaderColumn dataField='City'>City</TableHeaderColumn>
          <TableHeaderColumn dataField='StartDate'>Start Date</TableHeaderColumn>
          <TableHeaderColumn dataField='EndDate'>End Date</TableHeaderColumn>
          <TableHeaderColumn dataField='RegLink'>Registration</TableHeaderColumn>
        </BootstrapTable>
      );
    }
  }
itskrishnadev commented 4 years ago

try this this.refs.titleCol.handleFilter('Item name 3')

Taerarenai commented 4 years ago

Gave up on this a long while ago ( opened the issue 2 years ago lol). Thanks for the info i guess haha.

Gonna close this up.