0

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)

4

1 に答える 1

1

これをチェックしてくださいhttp://dev.sencha.com/deploy/ext-4.0.0/examples/grid/row-editing.html これは新しい GXT バージョンですが、変更をコミットしてもチェックボックスが更新されないことがわかります。GXTのバグのようです。

そして、これは最初の問題を解決するのに役立ちます: http://www.sencha.com/forum/showthread.php?266458-GridInlineEditing-fires-blur-event-immediately-after-cliking

于 2013-08-01T09:56:09.973 に答える