0
我想將按鈕添加到單元格中,但現在我準備好爲單元格的背景設置圖像,並處理點擊。如何將圖像添加到單元格?如何在GXT 2.2網格中添加圖像作爲單元格的背景
我想將按鈕添加到單元格中,但現在我準備好爲單元格的背景設置圖像,並處理點擊。如何將圖像添加到單元格?如何在GXT 2.2網格中添加圖像作爲單元格的背景
如果要在列中呈現按鈕,請參見setRenderer
ColumnConfig
的方法。
下面的操作將在網格中的每一行按鍵:
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;
}
}):
不幸的是所有的項目是第二GXT,我不能將其更改爲第三隻因爲一個按鈕 –