日期:2014-05-16  浏览次数:20541 次

extjs报’id'为空或不是对象,哎,真垃圾!!! - Web 开发 / Ajax
请帮忙看看吧,找不到原因啊。谢谢了!
JScript code
/*
* 专题班评价的JS页面
*/

Ext.onReady(function(){

//数据
var store= new Ext.data.Store({  
                        reader:new Ext.data.JsonReader({
                       root : 'root',                      
                       idProperty:'courseName', //********必须加!!!
                       totalProperty : 'totalCount',
                       fields:[{
                                name : 'courseName'                              
                              }
                               ]}),
                      proxy : new Ext.data.HttpProxy({
                             url : ctPath +'/EvaluationAction!getEvalueResultInfo.do'
                    }),
                    sortInfo :{field: "courseName", direction: "ASC"},
                    remoteSort: true
            }); 


//用于显示的GridPannel,主窗口************************************************** 
//主面板grid
var sm=new Ext.grid.CheckboxSelectionModel();
var ztevalgrid=new Ext.grid.GridPanel({
                                //title:'专题班评估',
                                renderTo:'evaluation-div',
                                 width:Ext.getCmp("tabpanel").getInnerWidth()-2,
                                height:Ext.getCmp("tabpanel").getInnerHeight()-2,
                                sm:sm,
                                store:store,
                                tbar:[
                                new Ext.ux.form.SearchField({
                                    store : store,   
                                    width : 260
                                    //data: ''
                                }),{
                                        text:'评价',
                                        handler:function(){
                                                            //ztb_evalue.show();
                                                          },
                                        iconCls : "icon-add"
                                       }],
                                
                                columns:[
                                        sm,
                                        {id:'courseName',header:'专题班名称',width:230,dataIndex:'courseName',sortable:true},
                                        //{header:'专题班代码',width:100,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'总分',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'培训设计',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'培训实施',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'培训管理',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'培训效果',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'评估率',width:80,dataIndex:'evaluCourseId',sortable:true},
                                        //{header:'备注',width:130,dataIndex:'evaluCourseId',sortable:true}
                                        ],
                                bbar: new Ext.PagingToolbar({
                                        pageSize: 25,
                                        store: store,
                                        displayInfo: true
                                     })
                                });
                                
  //用于显示的GridPannel,主窗口^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     
  //数据载入 ******必须加!!!
           store.load({
        params : {
            start : 0,
            limit : 15
        }
    });
 
})


------解决方案------------------