2012-07-18 87 views

回答

1

我们刚刚完成了这个工作,我们在SlickGrid v1.4.3中发现的问题是,由于它们共享GlobalEditorLock状态,所以遇到了两个光滑网格的问题。换句话说,当你从弹出的光滑网格中选择一个项目时,它会触发你在原始网格中设置的处理程序的提交事件。这是困难。我们得到了解决此加入了一个名为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,所以它不会与我们在原始网格上设置的编辑器进行交互。