0
현재 GXT3 표를 사용하여 사용자 지정 개체 인 EntityDAO의 데이터를 표시하고 있습니다.GXT 3 GridRowEditing SimpleComboBox 항목이 표시되지 않습니다.
이interface EntityDAOProperties extends PropertyAccess<EntityDAO> {
ModelKeyProvider<EntityDAO> id();
@Path("userInfo.name")
ValueProvider<EntityDAO, String> step();
@Path("outputInfo.name")
ValueProvider<EntityDAO, String> outputInfo();
}
디스플레이는 다음과 같습니다의 내가이 정보를 명시 적으로 원하는 디스플레이에 대한 인터페이스를 생성
Long id;
UserInfo userInfo;
OutputInfo outputInfo;
을 부르 자 ID와 복합 형 객체에 대한 두 개의 참조 : 이 클래스는 3 개 속성을 포함 완벽하게 괜찮아. 문제는 내가 그리드에 행을 추가/편집 할 수 있기를 원한다는 것입니다.
이렇게하려면, 내가 가지고 포함
GridRowEditing<EntityDAO> editing = createGridEditing(grid);
나는 내 라인을 클릭하고 GridRowEditing가, 콤보보다 더 많이 가지고하지 않는 것 보이게 배
SimpleComboBox<String> comboUser = new SimpleComboBox<String>(new LabelProvider<String>() {
@Override
public String getLabel(String item) {
return item;
}
});
for(...){
comboUser.add("entry " + i); // For instance
logger.info("entry : " +i); // For instance
i++;
}
comboUser.setEditable(false);
comboUser.setTriggerAction(TriggerAction.ALL);
1 행을 클릭하고 확장 화살표를 클릭해도 문제가 변경되지 않습니다. 이 당신을 도울 수
SimpleComboBox<Light> combo = new SimpleComboBox<Light>(new StringLabelProvider<Light>());
combo.setClearValueOnParseError(false);
combo.setPropertyEditor(new PropertyEditor<Light>() {
@Override
public Light parse(CharSequence text) throws ParseException {
return Light.parseString(text.toString());
}
@Override
public String render(Light object) {
return object == null ? Light.SUNNY.toString() : object.toString();
}
});
combo.setTriggerAction(TriggerAction.ALL);
combo.add(Light.SUNNY);
combo.add(Light.MOSTLYSUNNY);
combo.add(Light.SUNORSHADE);
combo.add(Light.MOSTLYSHADY);
combo.add(Light.SHADE);
// combo.setForceSelection(true);
editing.addEditor(cc2, new Converter<String, Light>() {
@Override
public String convertFieldValue(Light object) {
return object == null ? "" : object.toString();
}
@Override
public Light convertModelValue(String object) {
try {
return Light.parseString(object);
} catch (ParseException e) {
return null;
}
}
}, combo);
희망 :
답장을 보내 주셔서 감사합니다. 이것은 문제를 해결하지 못합니다. –