GXT 3.0.5 (商用ライセンス) を使用しています。
でグリッドを作成すると、Chrome でのみGridInlineEditing
奇妙なバグが発生します。
- では
setCLicksToEdit(ONE)
、列を編集できません (編集コンポーネントが表示され、すぐに消えます)。 - を使用
setCLicksToEdit(TWO)
すると、 を含むものを除くすべての列を編集できますCheckBox
:CheckBox
が表示されますが、クリックすると、編集が終了し、値が更新されません。
この Bean を数回表示するグリッドを使用して小さな例を作成しました。
public class MyBean {
private Integer id;
private String label;
private Boolean enabled;
public MyBean(Integer id, String label, Boolean enabled) {
this.id = id;
this.label = label;
this.enabled = enabled;
}
//Getters & Setters
}
そして対応するグリッド。できるだけシンプルにしました:
public class MyGrid extends Composite {
public interface MyPropertyAccess extends PropertyAccess<MyBean> {
ValueProvider<MyBean, Integer> id();
ValueProvider<MyBean, String> label();
ValueProvider<MyBean, Boolean> enabled();
}
public MyGrid(){
//Build columnModel
MyPropertyAccess propertyAccess = GWT.create(MyPropertyAccess.class);
ColumnConfig<MyBean, Integer> colId = new ColumnConfig<MyBean, Integer>(propertyAccess.id(),500, "ID");
ColumnConfig<MyBean, String> colLabel = new ColumnConfig<MyBean, String>(propertyAccess.label(), 500, "Label");
ColumnConfig<MyBean, Boolean> colEnabled = new ColumnConfig<MyBean, Boolean>(propertyAccess.enabled(), 500, "Enabled");
ColumnModel<MyBean> columnModel = new ColumnModel<MyBean>(Arrays.<ColumnConfig<MyBean,?>>asList(colId, colLabel, colEnabled));
//Create grid
Grid<MyBean> grid = new Grid<MyBean>(new ListStore<MyBean>(buildModelKeyProvider()), columnModel);
//Make it editable
GridInlineEditing<MyBean> inlineEditing = new GridInlineEditing<MyBean>(grid);
inlineEditing.addEditor(colLabel, new TextField());
inlineEditing.addEditor(colEnabled, new CheckBox());
inlineEditing.setClicksToEdit(ClicksToEdit.TWO);
//Fill store with dummy values
for(int i = 1;i<=30;i++){
grid.getStore().add(new MyBean(i, "Bean"+i, i%2==0));
}
this.initWidget(grid);
}
private ModelKeyProvider<MyBean> buildModelKeyProvider(){
return new ModelKeyProvider<MyBean>() {
@Override
public String getKey(MyBean item) {
return Integer.toString(item.getId());
}
};
}
}
私は何か間違ったことをしていますか、それとも GXT にバグがありますか?
注GridInlineEditing
: をaに置き換えることはできますがGridRowEditing
(動作します)、これはユーザーのニーズを満たしていません。
注:Firefoxでも同じ問題setCLicksToEdit(ONE)
がありますが、すべて問題ありませんsetCLicksToEdit(TWO)