[英]How to handle the click on the cell in the GXT 2.2 grid?
我正在尋找處理單元格單擊的方法。 如果以這種方式在網格中創建新列,該如何做:
column = new ColumnConfig();
column.setId("remove");
column.setHeader("Remove");
column.setWidth(100);
configs.add(column);
?
您必須處理ColumnConfig
所屬的網格上的單元格單擊。 例如,假設您有Grid grid = new Grid(new ColumnModel(column));
, 然后:
grid.addListener(Events.CellDoubleClick, new Listener<GridEvent>() {
public void handleEvent(GridEvent be) {
// be.getColIndex() gets the index of the column clicked on.
// if you know the index of `column`, you can compare that number to the colIndex
// if the numbers are equal, do whatever you want to do
// see docs for GridEvent at
// http://dev.sencha.com/deploy/gxt-2.2.5/docs/api/com/extjs/gxt/ui/client/event/GridEvent.html
}
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.