如何允许 SlickGrid 中的单元格导航出现验证错误?
我注意到,当发生验证错误时,用户将被锁定在该单元格中,直到错误得到解决。有没有办法让用户继续导航单元格?
这种方法对我有用,因为当他们离开单元格时我不会提交,而是等到他们单击“保存”按钮。因此,当存在错误时,该按钮将被禁用,但它们仍然可以自由地导航单元格。谢谢。
I've noticed that when a validation error occurs, the user is locked into that cell until the error is resolved. Is there a way to allow the user to continue to navigate cells?
This approach works for me b/c I don't commit when they leave the cell, but wait until they click a Save button. So, this button would be disabled while an error exists, but they are still free to navigate cells. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要实现自己的
editorLock
函数,该函数会传递给选项。与大多数 SlickGrid 一样,此功能的文档很少,但您可以通过 SlickGrid,并搜索名为commitCurrentEdit
的函数。editorLock
的示例位于文件slick.core.js
中另外,在渲染网格之前,您可以尝试执行以下操作:
You need to implement your own
editorLock
function, that is passed to options. This feature, just as most of SlickGrid, is poorly documented, ut you can watch through source code of SlickGrid, and search for function calledcommitCurrentEdit
.The example of
editorLock
is in the fileslick.core.js
Also, before rendering the grid you can try to do this: