[英]Is it possible to use a slickgrid inside an editor for another slickgrid?
我想为我的slickgrid中的列编写一个自定义编辑器。 理想情况下,此编辑器将包含另一个slickgrid,该过滤器允许用户过滤并选择多个项目。
我们已经做到了这一点,在SlickGrid v1.4.3中发现的问题是,由于两个光滑的网格共享GlobalEditorLock状态,因此您遇到了问题。 换句话说,当您从弹出式平滑网格中选择一项时,它将在您在原始网格中设置的处理程序上触发commit事件。 那是陷阱。 通过添加一个名为disableEditorCommit的新选项(默认情况下为false)并在handleClick方法中更改源来解决此问题:
if (options.enableCellNavigation && !columns[cell].unselectable) {
// if this is a popup then do not commit edits to the global editor
if (options.disableEditorCommit) {
scrollRowIntoView(row,false);
setSelectedCellAndRow($cell[0], (row === defaultGetLength()) || options.autoEdit);
} else {
// commit current edit before proceeding
if (validated === true || (validated === null && options.editorLock.commitCurrentEdit())) {
scrollRowIntoView(row,false);
setSelectedCellAndRow($cell[0], (row === defaultGetLength()) || options.autoEdit);
}
}
}
并在handleDblClick方法中:
validated = options.disableEditorCommit ? true : options.editorLock.commitCurrentEdit();
我们的弹出窗口slickgrid具有disableEditorCommit = true,因此它不与我们在原始网格上设置的编辑器对接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.