SmartGWT ListGrid-从选择中排除字段



我想请您帮助解决以下问题。

我有一个SmartGwtListGrid,它有多行。这个ListGrid有一个SelectionChangedHandler,它运行得很好。

我在这个ListGrid中添加了一个特殊的列(ListGridField),基本上我想防止点击时触发selectionChangeEvent。

这个特殊列有自己的recordclickHandler。

我只想排除此列形式更改ListGrid中的选定记录。

据你所知,有什么办法可以做到这一点吗?

提前谢谢。

由于行选择的事件不会告诉你点击了哪个单元格,因此无法告诉你是哪一列,我认为你需要使单元格可选,如果单元格在排除列中,则忽略该事件。

myGrid.setCanSelectCells(true);
myGrid.addCellSelectionChangedHandler(new CellSelectionChangedHandler() {
  public void onCellSelectionChanged(CellSelectionChangedEvent event) {  
    CellSelection selection = countryGrid.getCellSelection();
    //use to determine if excluded column is clicked:
    int[][] selectedCells = selection.getSelectedCells();
    //use to get selected row: 
    ListGridRecord record = selection.getSelectedRecord();
    //etc...
  }
}  

最新更新