I have a react-virtualized table where column sorting is enabled. My plan is to add a filter icon
next to column headers and do a Material-UI popover when someone clicks on it.
So here is what I did: I enabled headerRenderer
headerRenderer= {this.renderHeader}
My headerRenderer returns a component
renderHeader = (value) => {
// console.log(value)
return <ColumnFilterContainer label= {value.label} />
}
ColumnFilterContainer is as follows.
import React from 'react'
import ContentClear from 'material-ui/svg-icons/content/clear'
import FilterList from 'material-ui/svg-icons/content/filter-list'
const ColumnFilterContainer = (props) => {
const {label} = props
return <span>{label} <a onClick={console.log('TEST')} ><FilterList /></a></span>
}
export default ColumnFilterContainer
But when I click on the svg-icon it consoles out the 'TEST' but also resorts the table. How can I achieve what I would like to do. Is it doable?
Thanks