2013-08-01 2 views
0

GXT 3.0.5 (상용 라이센스)를 사용합니다.GridInlineEditing에서의 GXT 이상한 동작

나는 GridInlineEditing 그리드를 만들 때, 나는 크롬에 대한 몇 가지 이상한 버그가있는 경우에만 : setCLicksToEdit(ONE)으로, 열을 편집 할 수 없습니다

  • (에디션의 구성 요소는 다음 나타나는 immediatly 사라)
  • setCLicksToEdit(TWO)을 사용하면 CheckBox이 포함 된 열을 제외한 모든 열을 편집 할 수 있습니다. CheckBox이 표시되지만 클릭하면 버전이 완료되고 값이 업데이트되지 않습니다.

    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에 잘못된 것이 있습니까? 아니면 버그가 있습니까?

: 나는 GridRowEditing (작동)로 GridInlineEditing을 대체 할 수 있지만,이 사용자가 더 이상 필요에 맞지 않습니다.

: 파이어 폭스, 나는 setCLicksToEdit(ONE)과 같은 문제가 있지만, 모든 setCLicksToEdit(TWO)

답변

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

+0

내선 JS = GXT. 그들은 완전히 다른 도서관이며, 같은 회사에서 만든 것입니다. –