2013-06-19 204 views

回答

1

您必須處理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 
    } 
}); 
+2

而對於經常點擊,添加一個'Events.CellClick'聽衆。 –

+0

正確 - 在我的答案中,我打算放置'CellClick',但複製錯誤的事件名稱。 :) –

+0

@thy_stack_overfloweth我面臨類似的問題可以請看看,並提出解決方案這裏是我的問題http://stackoverflow.com/q/22610705/3277781 – Gundamaiah

相關問題