2012-07-18 86 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,所以它不會與我們在原始網格上設置的編輯器進行交互。