thanks for the reply. Actually the specs where much easier than I read them to be. I need to update the background color. I should be able to use a custom renderer for that. But I do have a question about afterOnCellMouseDown. I am trying to use that to get the cell coordinates when user clicks back on the colored cells. It does give me the data I need. However it repeatedly fires off which makes the browser blow up if I try to do any logic. How can this be controlled? Or is there another hook I need to use? Do I have to use some type of throttle? Different hook? I just need the coords of the cell I click on
afterRenderer={() => {
window.hotInstance = this.hotTableComponent.current.hotInstance;
this.hotTableComponent.current.hotInstance.addHook('afterOnCellMouseDown', (e, coords) => {
this.afterOnCellMouseDown(e, coords);
});
}}
afterOnCellMouseDown = (e, coords) => {
const state = [];
this.props.selectedCells.forEach(x => { state.push(x[0]); });
if (state.length > 0) {
// window.hotInstance.selectCells(state);
// eslint-disable-next-line array-callback-return
state.find(x => {
const col = x.includes(coords.col);
const row = x.includes(coords.row);
if (col && row) {
this.props.setBtnText('Un-Shutin');
this.props.setCellsToBeRemoved(x);
} else {
this.props.setBtnText('Shutin');
this.props.setCellsToBeRemoved([]);
}
});
}
};