2013-06-19 114 views

回答

2

如果要在列中呈現按鈕,請參見setRendererColumnConfig的方法。

下面的操作將在網格中的每一行按鍵:

ColumnConfig cfg = new ColumnConfig(); 
cfg.setRenderer(new GridCellRenderer() { 
    @Override 
    public Object render(M model, String property, 
        ColumnData config, int rowIndex, int colIndex, 
        ListStore<M> store, Grid<M> grid) { 
     Button button = new Button(); 
     // set up button based on params to this render function 
     // for example, the `model` argument is the item backing each row. 
     // this render method is called for each row in the grid 
     // see http://dev.sencha.com/deploy/gxt-2.2.5/docs/api/com/extjs/gxt/ui/client/widget/grid/GridCellRenderer.html 
     return button; 
    } 
}): 
1

無需手動添加已經有一個ButtonCell.

只是利用它。

而你可以Add icon甚至通過setIcon() method

+0

不幸的是所有的項目是第二GXT,我不能將其更改爲第三隻因爲一個按鈕 –

相關問題