jmls
31 Jul 2012, 12:55 AM
I have a combo box that is populated from a json proxy. However, I would like to add a custom option , one that does not exist in the database.
I was trying to add it in the afterrender event thus :
{ xtype: 'combobox',
store: 'Phone',
dataIndex: 'Phone_id',
displayField: 'MACAddress',
valueField: '_id',
fieldLabel: 'Phone',
name: 'Phone_id',
listeners: {
afterRender: function(combo,options){
var data = [];
var record = new Ext.data.Record({ MACAddress: 'No Phone', _id: ''});
},
},
},
however, I get the following error on the line
var record = new Ext.data.Record({ MACAddress: 'No Phone', _id: ''});
"Uncaught TypeError: Cannot read property 'items' of undefined " (ext-all.js:21)
what is missing ? I don't understand why the error is happening when all I am doing is creating a new record.
I was trying to add it in the afterrender event thus :
{ xtype: 'combobox',
store: 'Phone',
dataIndex: 'Phone_id',
displayField: 'MACAddress',
valueField: '_id',
fieldLabel: 'Phone',
name: 'Phone_id',
listeners: {
afterRender: function(combo,options){
var data = [];
var record = new Ext.data.Record({ MACAddress: 'No Phone', _id: ''});
},
},
},
however, I get the following error on the line
var record = new Ext.data.Record({ MACAddress: 'No Phone', _id: ''});
"Uncaught TypeError: Cannot read property 'items' of undefined " (ext-all.js:21)
what is missing ? I don't understand why the error is happening when all I am doing is creating a new record.