开发者

Ext JS EditorGridPanel not editable

开发者 https://www.devze.com 2022-12-22 01:49 出处:网络
I\'m trying to modify this example: http://www.extjs.com/deploy/dev/examples/writer/writer.html to make the all fields in the grid editable (currently only the one field is).

I'm trying to modify this example: http://www.extjs.com/deploy/dev/examples/writer/writer.html to make the all fields in the grid editable (currently only the one field is).

I've tried commenting out these lines in UserGrid.js (lines 118-120) as such:

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

But that only changes the field you can edit to the first one you try 开发者_Go百科to edit.

How do I make the entire grid editable?


In the http://www.extjs.com/deploy/dev/examples/writer/writer.js replace

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}
];

with

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()}
];
0

精彩评论

暂无评论...
验证码 换一张
取 消