0
好吧,我有一個IndexedColumn
我們可以在GWT的同一列上同時擁有ClickableTextCell和ButtonCell嗎?
public class IndexedColumn extends Column<List<String>, String>{
public IndexedColumn(int index){
super(new ClickableTextCell()); // by default it is ClickableTextCell
}
}
當創建列
IndexedColumn objectColumn=new IndexedColumn(6){
@Override
public String getCellStyleNames(Context context, List<String> object) {
if (object.get(12).equals("button")){
return getView().getRes().css().gwtCellButton();
}
else if(object.get(12).equals("1")){
return getView().getRes().css().redColor();
}
return getView().getRes().css().myClickableTextCellStyle();
}
}
// CSS
.myClickableTextCellStyleBold{
font-weight:bold;
}
.myClickableTextCellStyleNormal{
font-weight:normal !important;
}
.myClickableTextCellStyle, .myClickableTextCellStyleBold, .myClickableTextCellStyleNormal
{
cursor: pointer;
cursor: hand;
}
.gwt-Button, .gwtCellButton button, .gwtCellButtonSmall button {
margin: 0;
padding: 5px 7px;
text-decoration: none;
cursor: pointer;
cursor: hand;
font-size:small;
background: black;
border:1px solid #bbb;
border-bottom: 1px solid #a0a0a0;
border-radius: 3px;
-moz-border-radius: 3px;
color: white;
}
跑後,它可以拿起getView().getRes().css().redColor()
但沒有回暖getView().getRes().css().gwtCellButton()
。
是否有可能在同一列上同時擁有ClickableTextCell和ButtonCell,如果是,那麼該怎麼做?
我們可以有更簡單的解決方案嗎? – Tum
代碼太多,我輸了 – Tum