我新建了一个window,里面绑定了panel,panel中有数据,想用row editing实现双击某个行属性,实现编辑,但是报错
代码如下:
Ext.define("Shop", {
extend: 'Ext.data.Model',
fields: [
{ name: 'shopCode', type: 'string' },
{ name: 'shopName', type: 'string' },
{ name: 'shopStatus', type: 'string' },
{ name: 'createDate', type: 'string' },
{ name: 'shopScore', type: 'string' }
]
});
var shopStore = new Ext.data.Store({
model : "Shop",
autoLoad : true,
proxy : {
type : "ajax",
url : "getAllShop.action",
reader : {
type : 'json',
root : 'shopList'
}
}
});
Ext.define('B2B2C.ShopGridWindow', {
extend: 'Ext.ux.desktop.Module',
requires: [
'Ext.grid.*',
'Ext.data.*',
'Ext.util.*',
'Ext.state.*',
'Ext.form.*'
],
id:'s-grid-win',
init : function(){
this.launcher = {
text: '店铺管理',
iconCls:'icon-grid',
handler : this.createWindow,
scope: this
};
},
createWindow : function(){
var me = this;
shopStore.load();
var desktop = this.app.getDesktop();
var win = desktop.getWindow('s-grid-win');
if(!win){
win = desktop.createWindow({
id: 's-grid-win',
title:'店铺管理',
width:740,
height:480,
iconCls: 'icon-grid',
animCollapse:false,
constrainHeader:true,
layout: 'fit',
items: [
{
border: false,
xtype: 'grid',
id: 's-grid',
store: shopStore,
plugins : [
Ext.create('Ext.grid.plugin.RowEditing',{
clicksToEdit:2
})
],
columns: [
new Ext.grid.RowNumberer(),
{
text: "店铺编码",
width: 100,
sortable: true,
dataIndex: 'shopCode',
editor :{
xtype: "textfield"
}
},
{
text: "店铺名称",
width: 200,
sortable: true,
dataIndex: 'shopName',
editor :{
xtype: "textfield"
}
},
{
text: "店铺分数",
width: 70,
sortable: true,
dataIndex: 'shopScore',
editor :{
xtype: "textfield"
}
},
{
text: "创建时间",
width: 160,
sortable: true,
dataIndex: 'createDate',
editor :{
xtype: "textfield"
}
},
{
text: "审核状态",
width: 160,
sortable: true,
dataIndex: 'shopStatus',
editor :{
xtype: "textfield"
}
}
]
}
]
报错信息:TypeError: h is undefined
...k=0,m=l.length;k<m;k++){q=l[k];o=q.from;p=q.to;if(h===o||h.substring(0,o.length)...
Extjs默认的column只有两种,文本和actioncolumn,当然,我们可以返回一个zi d......
答案就在这里:Extjs 可 编辑的grid行
----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?