I have a problem with custom ag-grid cell editor. I want to get state from Redux but if I use connect function from 'react-redux' it hides isPopup function which is needed by ag-grid. In result my editor is not visible outside of editing cell.
class SelectEditor extends React.Component {
getValue = () => '123'
isPopup = () => true
render() {
const unselected = { border: '1px solid transparent', padding: 4 };
const selected = { border: '1px solid lightgreen', padding: 4 };
const happyStyle = this.props.happy ? selected : unselected;
const sadStyle = !this.props.happy ? selected : unselected;
return (
<div ref='container'>
<img src='https://www.ag-grid.com/images/smiley.png' style={happyStyle} />
<img src='https://www.ag-grid.com/images/smiley-sad.png' style={sadStyle} />
</div>
);
}
}
const mapStateToProps = state => ({ happy: state.clientsData });
const mapDispatchToProps = dispatch => ({});
// 1) popup works - I see component
export default SelectEditor;
// 2) popup doesn't work
export default connect(mapStateToProps, mapDispatchToProps)(SelectEditor);
Any ideas how to create proper component?