2010-03-01 4 views
2

이 예제를 수정하려고합니다 : http://www.extjs.com/deploy/dev/examples/writer/writer.html 그리드의 모든 필드를 편집 가능하게 만듭니다 (현재 하나의 필드 만 있습니다).Ext JS EditorGridPanel을 편집 할 수 없습니다.

//this.stopEditing(); 
this.store.insert(0, u); 
//this.startEditing(0, 1); 

을하지만 당신은 당신이 편집하려고 첫 번째로 편집 할 수있는 필드를 변경하는 것이 :

나는 같은 UserGrid.js (라인 118 ~ 120)에이 라인을 주석 시도했습니다.

전체 표식을 어떻게 편집 가능하게 만들 수 있습니까? http://www.extjs.com/deploy/dev/examples/writer/writer.js에서

답변

5

대체

var userColumns = [ 
    {header: "ID", width: 40, sortable: true, dataIndex: 'id'}, 
    {header: "Email", width: 100, sortable: true, dataIndex: 'email', editor: textField}, 
    {header: "First", width: 50, sortable: true, dataIndex: 'first', editor: textField}, 
    {header: "Last", width: 50, sortable: true, dataIndex: 'last', editor: textField} 
]; 

var userColumns = [ 
    {header: "ID", width: 40, sortable: true, dataIndex: 'id'}, 
    {header: "Email", width: 100, sortable: true, dataIndex: 'email', editor: new Ext.form.TextField()}, 
    {header: "First", width: 50, sortable: true, dataIndex: 'first', editor: new Ext.form.TextField()}, 
    {header: "Last", width: 50, sortable: true, dataIndex: 'last', editor: new Ext.form.TextField()} 
];