老是报缺少对象,实在看不出来那里出错了 求各位帮忙

Morik.Office.DocrecPanel = function(config) {
Morik.Office.DocrecPanel.superclass.constructor.call(this, config);

// 加上服务器上的jsp数据生成
// 生成Company类型
var proxy = new Ext.data.HttpProxy( {
    url : 'company.jsp'
});

var recordType = new Ext.data.Record.create([ {
    name : "id",
    type : "int"
},{
    name:"date",
    type:"date"
    }, {
    name : "name",
    type : "string"
}, {
    name : "add",
    type : "string"
}, {
    name : "tel",
    type : "string"
},{
    name:'indoor',
    type:'bool'
    }]);

var reader = new Ext.data.JsonReader( {
totalProperty : "results",
    root : "rows",
    id : "id"
}, recordType);

//
// // 定义store
var store = new Ext.data.Store( {
proxy : proxy,
reader : reader
});
this.store=store;
// 第二,讲一下cm,grid
var fm = Ext.form;

[color=red] var checkColumn = new Ext.grid.CheckColumn ({
header: "Indoor?",
dataIndex: 'indoor',
width: 55
});[/color]
function formatDate(value){
return value ? value.dateFormat('M d, Y') : '';
};

var cm = new Ext.grid.ColumnModel( {
    defaultSortable : true,
    defaultWidth : 100,
    columns : [ {
        header : '编号',
        dataIndex : 'id'
    }, {
        header:'日期',
        dateIndex:'date',
         renderer: formatDate,
       editor: new fm.DateField({
            format: 'm/d/y',
            minValue: '01/01/06',
            disabledDays: [0, 6],
            disabledDaysText: 'Plants are not available on the weekends'
        })
        },{
        header : '名称',
        dataIndex : 'name',
        editor: new fm.TextField({
           allowBlank: false
       })
    }, {
        header : '地址',
        width : 300,
        dataIndex : 'add',
                    editor: new fm.TextField({
           allowBlank: false
       })
    }, {
        header : '电话',
        width : 300,
        dataIndex : 'tel',
        editor: new fm.NumberField({
        allowBlank: false,
        allowNegative: false,
        maxValue: 100000
        })
    }
    ]
});


var Plant = Ext.data.Record.create([
       // the "name" below matches the tag name to read, except "availDate"
       // which is mapped to the tag "availability"
       {name: 'id', type: 'string'},
       {name: 'date', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},
       {name: 'name'},
       {name: 'add', type: 'float'},             // automatic date conversions
       {name: 'tel', type: 'string'},
       {name: 'indoor', type: 'bool'}

  ]);
var grid = new Ext.grid.EditorGridPanel( {
    cm : cm,
    store : store,
    width : 1000,
    height : 400,
    autoExpandColumn:'common',

// title:'Edit Plants?',
// frame:true,
plugins:checkColumn,
clicksToEdit:1,
tbar:[{ text: 'Add Plant',
handler : function(){
var p = new Plant({
id: 'New Plant 1',
date:'',
name:'',
add: 'Mostly Shade',
tel: 0,
availDate: (new Date()).clearTime(),
indoor:false

            });
            grid.stopEditing();
            store.insert(0, p);
            grid.startEditing(0, 0);
        }}],
    loadMask:{msg:'正在载入数据,请稍等...'},
    title : '公司列表'
});



    // trigger the data store load

store.load();

this.add(grid);



// 第三、调整,tbar分页,工具栏


var checkColumn = new Ext.grid.CheckColumn();
Ext.grid.CheckColumn = function(config){
Ext.apply(this, config);
if(!this.id){
    this.id = Ext.id();
}
this.renderer = this.renderer.createDelegate(this);

};

Ext.grid.CheckColumn.prototype ={
init : function(grid){
this.grid = grid;
this.grid.on('render', function(){
var view = this.grid.getView();
view.mainBody.on('mousedown', this.onMouseDown, this);
}, this);
},

onMouseDown : function(e, t){
    if(t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){
        e.stopEvent();
        var index = this.grid.getView().findRowIndex(t);
        var record = this.grid.store.getAt(index);
        record.set(this.dataIndex, !record.data[this.dataIndex]);
    }
}

};

}
Ext.extend(Morik.Office.DocrecPanel, Ext.Panel, {});

出错提示代码为红色标注的这段 提示为图片所示,求各位帮忙找一下错误原因 ,3Q
[b]问题补充:[/b]
TO:lovewhzlq (架构师)
按照你的写法,提示出错信息依然存在 ,且为同一错误信息,郁闷了
[b]问题补充:[/b]
TO:lovewhzlq 因为EXTJS是新上手 所以很多代码不是自己写的

var checkColumn = new Ext.grid.CheckColumn();
Ext.grid.CheckColumn = function(config){
Ext.apply(this, config);
if(!this.id){
this.id = Ext.id();
}
this.renderer = this.renderer.createDelegate(this);
};

Ext.grid.CheckColumn.prototype ={
init : function(grid){
this.grid = grid;
this.grid.on('render', function(){
var view = this.grid.getView();
view.mainBody.on('mousedown', this.onMouseDown, this);
}, this);
},

onMouseDown : function(e, t){ 
    if(t.className && t.className.indexOf('x-grid3-cc-'+this.id) != -1){ 
        e.stopEvent(); 
        var index = this.grid.getView().findRowIndex(t); 
        var record = this.grid.store.getAt(index); 
        record.set(this.dataIndex, !record.data[this.dataIndex]); 
    } 
} 

};
这段代码就是从ext-js的范例里拿过来的 感觉是错在这里 跟上面的代码连续不上
[b]问题补充:[/b]
TO yourgame
我没用firefox 我用的是IE的插件调试的 结果差不多的吧
[b]问题补充:[/b]
TO yourgame 你给我的代码调试出来报错信息如下图所示,点击进去看到的是ext-all-debug.js里面的一段代码 ,不过想想是不会这个JS里面的错误
后来自己调试了下发现是autoExpandColumn : 'common',这段代码出的错 将这段代码注释掉后就正常 无报错了 PS:这个JS是点击左侧tree时所调用到的,装载到右边tabpanel中的代码

你没有提供company.jsp我无法继续调试

不过可以看出来你的问题所在,我修改了一下,你测试看看

[code="js"]Ext.ns("Morik.Office");
Morik.Office.DocrecPanel = function(config) {
Morik.Office.DocrecPanel.superclass.constructor.call(this, config);
var proxy = new Ext.data.HttpProxy({
url : 'company.jsp'
});
var recordType = new Ext.data.Record.create([{
name : "id",
type : "int"
}, {
name : "date",
type : "date"
}, {
name : "name",
type : "string"
}, {
name : "add",
type : "string"
}, {
name : "tel",
type : "string"
}, {
name : 'indoor',
type : 'bool'
}]);

var reader = new Ext.data.JsonReader({
        totalProperty : "results",
        root : "rows",
        id : "id"
    }, recordType);
var store = new Ext.data.Store({
        proxy : proxy,
        reader : reader
    });
this.store = store;
var fm = Ext.form;

var checkColumn = new Ext.grid.CheckColumn({
        header : "Indoor?",
        dataIndex : 'indoor',
        width : 55
    });
function formatDate(value) {
    return value ? value.dateFormat('M d, Y') : '';
};

var cm = new Ext.grid.ColumnModel({
        defaultSortable : true,
        defaultWidth : 100,
        columns : [{
                header : '编号',
                dataIndex : 'id'
            }, {
                header : '日期',
                dateIndex : 'date',
                renderer : formatDate,
                editor : new fm.DateField({
                        format : 'm/d/y',
                        minValue : '01/01/06',
                        disabledDays : [0, 6],
                        disabledDaysText : 'Plants are not available on the weekends'
                    })
            }, {
                header : '名称',
                dataIndex : 'name',
                editor : new fm.TextField({
                        allowBlank : false
                    })
            }, {
                header : '地址',
                width : 300,
                dataIndex : 'add',
                editor : new fm.TextField({
                        allowBlank : false
                    })
            }, {
                header : '电话',
                width : 300,
                dataIndex : 'tel',
                editor : new fm.NumberField({
                        allowBlank : false,
                        allowNegative : false,
                        maxValue : 100000
                    })
            }]
    });

var Plant = Ext.data.Record.create([{
        name : 'id',
        type : 'string'
    }, {
        name : 'date',
        mapping : 'availability',
        type : 'date',
        dateFormat : 'm/d/Y'
    }, {
        name : 'name'
    }, {
        name : 'add',
        type : 'float'
    }, {
        name : 'tel',
        type : 'string'
    }, {
        name : 'indoor',
        type : 'bool'
    }

]);
var grid = new Ext.grid.EditorGridPanel({
        cm : cm,
        store : store,
        width : 1000,
        height : 400,
        autoExpandColumn : 'common',
        plugins : checkColumn,
        clicksToEdit : 1,
        tbar : [{
                text : 'Add Plant',
                handler : function() {
                    var p = new Plant({
                            id : 'New Plant 1',
                            date : '',
                            name : '',
                            add : 'Mostly Shade',
                            tel : 0,
                            availDate : (new Date()).clearTime(),
                            indoor : false
                        });
                    grid.stopEditing();
                    store.insert(0, p);
                    grid.startEditing(0, 0);
                }
            }],
        loadMask : {
            msg : '正在载入数据,请稍等...'
        },
        title : '公司列表'
    });
store.load();

this.add(grid);

}
Ext.extend(Morik.Office.DocrecPanel, Ext.Panel, {});

Ext.grid.CheckColumn = function(config) {
Ext.apply(this, config);
if (!this.id) {
this.id = Ext.id();
}
this.renderer = this.renderer.createDelegate(this);
};

Ext.grid.CheckColumn.prototype = {
init : function(grid) {
this.grid = grid;
this.grid.on('render', function() {
var view = this.grid.getView();
view.mainBody.on('mousedown', this.onMouseDown, this);
}, this);
},

onMouseDown : function(e, t) {
    if (t.className && t.className.indexOf('x-grid3-cc-' + this.id) != -1) {
        e.stopEvent();
        var index = this.grid.getView().findRowIndex(t);
        var cindex = this.grid.getView().findCellIndex(t);
        var record = this.grid.store.getAt(index);
        var field = this.grid.colModel.getDataIndex(cindex);
        var e = {
            grid : this.grid,
            record : record,
            field : field,
            originalValue : record.data[this.dataIndex],
            value : !record.data[this.dataIndex],
            row : index,
            column : cindex,
            cancel : false
        };
        if (this.grid.fireEvent("validateedit", e) !== false && !e.cancel) {
            delete e.cancel;
            record.set(this.dataIndex, !record.data[this.dataIndex]);
            this.grid.fireEvent("afteredit", e);
        }
    }
},

renderer : function(v, p, record) {
    p.css += ' x-grid3-check-col-td';
    return '<div class="x-grid3-check-col' + (v ? '-on' : '') + ' x-grid3-cc-'
        + this.id + '">&160;</div>';
}

};[/code]

这样写好点

var checkColumn = new Ext.grid.CheckColumn({
header: 'Indoor?',
dataIndex: 'indoor',
width: 55
});

Ext.grid.CheckColumn这个对象是没是没有定义啊,把它的定义放到前面看

你截的图和你给的代码,我都无法帮你确认错误

你可以使用火狐浏览器看看错误在什么地方。这样详细一些(firebug)

Grid 的Ext.grid.CheckColumn的插件,没用用过 希望贴出来才能知道问题

对,问题就是这一段,你应该把他写在DocrecPanel类的外面。
这个是我的示例

[url]http://yourgame.iteye.com/blog/245619[/url]