在代码里加alert("q")测试出错位置,发现是下面代码有问题
   var grid = new Ext.grid.EditorGridPanel({
            id:'grid',
            store: store,
            cm: cm,
            cls : 'vline-on',
            renderTo: 'editor-grid',
            width: 840,
            height: 300,
            autoExpandColumn: 'ID',
            title: '日记账录入',
            frame: true,
            clicksToEdit: 1,
            //设置单行选中 删除的时候,就删除这一行
            selModel: new Ext.grid.RowSelectionModel({ singleSelect: true }),
            tbar: 
            [ {
               xtype:'hidden',
               id:'action',
                value:'QUERY_T_SYS_USER_ACTION'
              },'账户:'
              ,{
                xtype : "combo", 
                name : '账户', 
                id : 'cbo_account', 
                width : 140, 
                maxLength : 25, 
              }
              ,'商店:'
             ,{
                xtype : "combo", 
                name : '商店', 
                id : 'cbo_shop', 
                width : 140,
                maxLength : 25 ,
              },'月份'
               ,{
                xtype : "textfield", 
                name : '月份', 
                id : 'txt_month',
                width : 120, 
                maxLength : 10 ,
              }
              ,{
                xtype : "button", 
                name : 'startTime', 
                id : 'btn_select', 
                text:'查询', 
                width : 60, 
              }
           ]
            ,header:true,
            bbar: [
             {
                text: '新增交易',
                handler: function () {
                   var n = grid.getStore().getCount();// 获得总行数
                     var p = new Diary({
                        id:newGuid() ,
                        time:(new Date()).clearTime(),
                        moneyType:"收入",
                        money:0,type:"其它",
                        name:"新增数据",
                        lastmoney:0
                     });
                       grid.stopEditing();// 停止编辑
                       store.insert(n, p);// 插入到store里面的最后一行
                }
            }//增加一行的结束
            ]
        });  求高手指教哪里错了.