gpt4 book ai didi

javascript - Ext JS EditorGridPanel 不可编辑

转载 作者:行者123 更新时间:2023-11-29 17:32:29 26 4
gpt4 key购买 nike

我正在尝试修改此示例:http://www.extjs.com/deploy/dev/examples/writer/writer.html使网格中的所有字段都可编辑(目前只有一个字段是可编辑的)。

我试过在 UserGrid.js 中注释掉这些行(第 118-120 行):

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

但这只会将您可以编辑的字段更改为您尝试编辑的第一个字段。

如何使整个网格可编辑?

最佳答案

http://www.extjs.com/deploy/dev/examples/writer/writer.js替换

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

关于javascript - Ext JS EditorGridPanel 不可编辑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2359236/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com