首页 > 代码库 > TypeError: record.get is not a function

TypeError: record.get is not a function

错误信息为:TypeError: record.get is not a function 
custCardCode.setValue(record.get(‘custCardCode‘));


    items : [{                            xtype : ‘button‘,                            text : ‘确定‘,                            listeners : {                                ‘click‘:function(){                                    var grid = Ext.getCmp(‘custCardCode-grid‘);                                        var record = grid.getSelectionModel().getSelection();                                    if(record.length == 0){                                        Ext.Msg.alert(‘提示‘, ‘请选择一条记录!‘);                                        return;                                    }                                    var custCardCode = Ext.getCmp(me.custCardCodeId);                                    if(custCardCode){                                        custCardCode.setValue(record.get(‘custCardCode‘));  //提示错误处   
//解决方法 custCardCode.setValue(record[0].get(‘custCardCode‘)); } me.close(); } } }]