【发布时间】:2018-11-03 05:57:44
【问题描述】:
我想知道,如何访问 react-handsontable 中的 selectColumns 方法。我已经尝试将引用分配给热表组件<HotTable refs="hot"/>,但我仍然无法访问 selectColumns 方法。
感谢您阅读此问题。
【问题讨论】:
标签: javascript reactjs handsontable
我想知道,如何访问 react-handsontable 中的 selectColumns 方法。我已经尝试将引用分配给热表组件<HotTable refs="hot"/>,但我仍然无法访问 selectColumns 方法。
感谢您阅读此问题。
【问题讨论】:
标签: javascript reactjs handsontable
@Sagar 还有其他方法吗?如果我们在其他组件中包含 HotTable 并且不能以这种方式渲染它,那就不太方便了。 如果我们从示例中谈到这一行
const exampleComponent = ReactDOM.render(
<ExampleComponent />, document.getElementById('example')
);
window.hotInstance = exampleComponent.refs.hot.hotInstance;
没关系,当我们将它渲染为一个单独的组件时。但是如果我在 App 组件中导入它,然后通过 ReactDom.render 渲染 App 组件,我没有 refs,只有空对象
【讨论】: