How do I use an editable NumberCell in GWT Celltable?
Does anybody know how to achieve this?
I want to add a NumberCell to a GWT CellTable and want to use inline editing as with EditTextCell.
For a EditTextCell I use:
Column<Parameter, String> editableColumn = new Column<Parameter, String>(
new EditTextCell()) {
@Override
public String getValue(Parameter parameter) {
return parameter.getString();
}
};
I want to use an "editable NumberCell", but don't have a clue how to do this.
开发者_开发知识库HELP me please! :)
For a NumberCell:
Column<Parameter, Number> column = new Column<Parameter, Number>(
new NumberCell()) {
@Override
public Number getValue(Parameter parameter) {
return (Number) parameter.getNumberValue();
}
};
There isn't a editable cell for numbers in GWT. You could copy paste the EditTextCell and change it to use numbers instead of Strings. Plus you have to check on every keydown if the pressed key was a number key.
精彩评论