在BasicColumn的customRender里面,如何优雅的触发表格的刷新? #1036
Unanswered
SeanLiangYoung
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
遇到一个问题
在BasicColumn的customRender里面,实现了一个Switch,基于业务的需求切换状态的时候,需要发送请求并且在满足条件的时候,刷新整个table。大概是下面的样子:
可以发现,为了触发刷新,我通过document.click()模拟点击实现的。写法过于丑恶了。
我尝试为这个table写一个单的的hooks,于是我实现了一个 useMyTable(),并把reload暴露了出来,如下:
然后,在customRender中使用,但是却报错了,对应的源码如下:
这个是不是说 getTableInstance() 被调用的时候,tableRef已经不存在了?这是因为什么?
以及我上面的问题:
Beta Was this translation helpful? Give feedback.
All reactions