Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

覆盖或销毁表格所在的DOM后报错 #282

Open
canuran opened this issue Mar 2, 2023 · 6 comments
Open

覆盖或销毁表格所在的DOM后报错 #282

canuran opened this issue Mar 2, 2023 · 6 comments

Comments

@canuran
Copy link

canuran commented Mar 2, 2023

虽然不影响使用,因为我把DOM都销毁了,但是看到自己的程序里报错还是很难受,有报错测试人员也不给通过,无论是否影响使用

image

@baukh789
Copy link
Owner

baukh789 commented Mar 3, 2023

有销毁场景时,参考以下方式:

  • 原生模式: 调用GridManager.destroy(table);
  • 框架模式: 通过框架自带条件进行组件移除,如vue的 v-if

@canuran
Copy link
Author

canuran commented Mar 3, 2023

单页面模式中,外层框架直接把表格所在的区域覆盖了
使用GridManager.destroy(table)之后覆盖DOM也会报错
看起来是个timeout处理函数,不受destroy控制

@baukh789
Copy link
Owner

baukh789 commented Mar 3, 2023

你可以发一下引用及销毁的方式

@canuran
Copy link
Author

canuran commented May 30, 2023

你可以发一下引用及销毁的方式

这还真不太好提取,就是用$('container').html('newHtml')把表格所在的父标签整个都覆盖了(相当于换了子页面,非iframe),然后再GridManager.destroy(table)并重新创建表格时就会报上述错误,虽然不影响使用,但是QA流程上要求不能有报错,强迫症也很难受

@baukh789
Copy link
Owner

覆盖前执行destroy

@canuran
Copy link
Author

canuran commented May 31, 2023

destroy

可是加载页面是上级组件,它并不知道这里面有个table需要destroy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants