Gwt 如何在GXT中使用Integer NumberField
我正在使用GXT3并使用:Gwt 如何在GXT中使用Integer NumberField,gwt,gxt,Gwt,Gxt,我正在使用GXT3并使用: NumberField<Double> code = new NumberField<Double>(new DoublePropertyEditor()); NumberField code=newnumberfield(new doublePropertyEdit()); “NumberField”可以使用什么?没有IntegerPropertyEditor,我不能简单地执行以下操作: NumberField<Integer>
NumberField<Double> code = new NumberField<Double>(new DoublePropertyEditor());
NumberField code=newnumberfield(new doublePropertyEdit());
“NumberFieldNumberField<Integer> code = new NumberField<Integer>(new IntegerPropertyEditor());
NumberField code=newnumberfield(newintegerpropertyeditor());
多亏了Patrice,我将其用作解决方案:
NumberField<Integer> code = new NumberField<Integer>(new NumberPropertyEditor.IntegerPropertyEditor());
NumberField code=newnumberfield(newnumberPropertyEditor.IntegerPropertyEditor());
NumberPropertyEditor类中有一个
您可以创建自定义IntegerNumber字段以简化此操作:
import com.sencha.gxt.widget.core.client.form.NumberPropertyEditor;
public class IntegerNumberField extends BaseNumberField<Integer>{
public IntegerNumberField() {
super(new NumberPropertyEditor.IntegerPropertyEditor());
}
}
import com.sencha.gxt.widget.core.client.form.NumberPropertyEditor;
公共类IntegerNumber字段扩展了BaseNumberField{
公共整数编号字段(){
super(新的NumberPropertyEditor.IntegerPropertyEditor());
}
}
谢谢genius与“new NumberPropertyEditor.IntegerPropertyEditor()配合得很好”