views:

417

answers:

1

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 to edit.

How do I make the entire grid editable?

+3  A: 

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