Hi there,
I am trying to use the filters plugin since I want to pre-set filter values on load of the table.
Before that I need to reference the instance of the handsontable, I am using React 16 with a React wrapper of handsontable, I tried follow this page https://handsontable.com/docs/7.1.1/frameworks-wrapper-for-react-hot-reference.html , but I keep getting error saying:
TypeError: this.hotTableComponent.current is null
What I did was:
constructor(props) {
super(props);
this.hotTableComponent = React.createRef();
}
in render:
< HotTable ref={this.hotTableComponent} >
Then, I tried access the plugin:
const filtersPlugin = this.hotTableComponent.current.hotInstance.getPlugin(‘filters’);
I tried console log this.hotTableComponent
I get an object of current null, as below:
current: null
: {…}
defineGetter: function defineGetter()
defineSetter: function defineSetter()
lookupGetter: function lookupGetter()
lookupSetter: function lookupSetter()
proto:
constructor: function Object()
hasOwnProperty: function hasOwnProperty()
isPrototypeOf: function isPrototypeOf()
propertyIsEnumerable: function propertyIsEnumerable()
toLocaleString: function toLocaleString()
toSource: function toSource()
toString: function toString()
valueOf: function valueOf()
<get proto()>: function proto()
<set proto()>: function proto()
Can you give me any help?
Thank you
Terry