【发布时间】:2015-02-20 07:27:17
【问题描述】:
我正在尝试使用网格创建编辑器,现在我有这样的变体:
var panelWithGrid = Ext.create('Ext.grid.Panel', {
store: cellEditorGridStore,
autoScroll: true,
width: 300,
height: 200,
sortable: true,
title: "My Editor",
...
columns: [
{
dataIndex: "first",
width: "13%",
text: "First"
},
{
dataIndex: "second",
width: "87%",
text: "Second"
}
],
bbar: [
{
xtype: "button",
text: "change value of cell",
handler: function(){
//close action + inserting of selected value from one grid to another?
}
},
{
xtype: "button",
text: "close editor",
handler: function(){
//normal close action? tried to hide, that works bad.
}
}
]
});
var myOwnCellEditor = Ext.create('Ext.grid.CellEditor', {
autoCancel: true,
closeAction: 'hide',
field: panelWithGrid
});
此外,我在所有列之一中创建了另一个带有 getEditor 属性的网格
...
getEditor: function(record){
if(record.raw.myColumnIndex==="gridEditor"){
Ext.Ajax.request({
...
async: false,
success: function(response, options){
...//downloading of cellEditorGridStore
}
}
return myOwnCellEditor;
}
所以我对这样的编辑器有很多问题。当我单击单元格进行编辑时,出现错误:
Uncaught TypeError: undefined is not a functionext-all.js:38
Ext.define.startEditext-all.js:38
Ext.define.showEditorext-all.js:38
b
当我尝试隐藏编辑器时,第二次显示不正确。您知道实现此类编辑器的更好方法吗?
【问题讨论】:
标签: javascript extjs extjs4.2 tablecelleditor