Murcielago楠 2015-08-18 15:45 采纳率: 0%
浏览 2640

ExtJS grid行编辑问题

我新建了一个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)...

  • 写回答

1条回答 默认 最新

  • Robot-S 2015-08-18 15:48
    关注

    Extjs默认的column只有两种,文本和actioncolumn,当然,我们可以返回一个zi d......
    答案就在这里:Extjs 可 编辑的grid行
    ----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

    评论

报告相同问题?

悬赏问题

  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了