Search code examples
javascriptreactjshandsontable

How to access and change selectColumns core method inside react-handsontable?


I want to know that, how to access selectColumns menthod inside react-handsontable. I already tried to assign refs to hot table component <HotTable refs="hot"/> but still i cant access selectColumns method.

Thanks for reading this question.


Solution

  • @Sagar Any other approaches? It's not so convenient if we include HotTable in other components and can't render it in such way. If we speak about this rows from example

    const exampleComponent = ReactDOM.render(
    <ExampleComponent />, document.getElementById('example')
    );
    window.hotInstance = exampleComponent.refs.hot.hotInstance;
    

    it's okay, when we render it as a separate component. But if I import it in App component and then render App component via ReactDom.render, I have no refs, just empty object