PDA

View Full Version : Object #<an Object> has no method 'join'



webarnie
23 Feb 2011, 6:38 AM
I have a listView on a page and want to add a new row to the store. When I do this I get an exception TypeError: Object #<an Object> has no method 'join'. I have searched the forum but have not found this. What is causing this error and how can i fix it?

Code to create the record


onButtonProcess : function(button, e) {
//TODO add form validation
var newRecord = [];
newRecord.push({
accountType : Ext.getCmp("filter").value,
name : Ext.getCmp("names").getValue(),
routingNumber: Ext.getCmp("routingNumber").getValue(),
accountNumber: Ext.getCmp("accountNumber").getValue(),
nickName: Ext.getCmp("nickName").getValue()
});
newBankRecord(newRecord);
var win = Ext.getCmp('bankInformationInput');
win.close();


code that inserts the new record into the store


function newBankRecord(bankRecord){
try {
Ext.getCmp("bankInformationListview").store.add(bankRecord);
} catch(e) {
Ext.MessageBox.alert("Execption has occured " + e);
}
}

Condor
24 Feb 2011, 8:24 AM
You are adding a plain object instead of a Record instance.


var recordType = Ext.getCmp("bankInformationListview").store.recordType;
var record = new recordType({accountType: ...}, id);