PDA

View Full Version : Error:Uncaught TypeError: Object [object Object] has no method 'get'



sathyan_8294
1 Nov 2011, 1:01 AM
Ext.regModel('Contact', {
fields: ['firstName', 'lastName']
});


var store = new Ext.data.Store({
model: 'Contact',
sorters: 'firstName',


data: [
{firstName: 'Rengarajan', lastName: 'Nandhasamy'},
{firstName: 'Sathyanarayanan', lastName: 'Damodarasamy'},
{firstName: 'Anand', lastName: 'Kumar'},
{firstName: 'Prakash', lastName: 'Muthu'},
{firstName: 'Vijay', lastName: 'Chandrasekar'},
{firstName: 'Surya', lastName: 'Sivakumar'},
{firstName: 'Kamalakashan', lastName: 'David'},
{firstName: 'Rajinikanth', lastName: 'Balaji'},
{firstName: 'Eswar', lastName: 'Venkat'},
{firstName: 'Viswanth', lastName: 'Arun'},
{firstName: 'Mani', lastName: 'Kathick'},
{firstName: 'Perunchithiran', lastName: 'Velu'},
{firstName: 'Senthil', lastName: 'Boopathy'},
{firstName: 'Ashok', lastName: 'Malik'},
{firstName: 'Thiyagu', lastName: 'Murugan'},
{firstName: 'Dhanush', lastName: 'GangaiAmaran'},
{firstName: 'Rajendran', lastName: 'Radhakrishnan'},
{firstName: 'Bala', lastName: 'Gopi'},
{firstName: 'Rajesh', lastName: 'Kumarasivam'}
]
});


Ext.setup({
onReady: function () {

var panel1=new Ext.Panel({

dockedItems: [{
dock: 'top',
xtype: 'toolbar',
title:'Home',
items:[{ xtype: 'spacer' },{
ui: 'forward', text: 'Next',


handler: function () {
mainpanel.setActiveItem(panel2, { type: 'slide' });
}
}]
}],
items:[{
xtype: 'list',
style: 'background-color: Transparent;',
id: 'MyList',

fullscreen: true,

/*onItemDisclosure: {
scope: 'test',
getGroupString : function(record) {
return record.get('firstName')[0];
},
handler: function(record) {

alert('Disclose more info for ' + record.get('firstName'));
panel4.update(record.get('firstName'));
mainpanel.setActiveItem(panel4, { type: 'slide' });

}
},*/

onItemDisclosure : true,
listeners : {
itemtap : function(record,index,item,e){
if (e.getTarget('.x-list-disclosure')) {
Ext.Msg.alert("Disclosure clicked!");
} else {
panel4.update(record.get('firstName'));---- here shown error:Uncaught TypeError: Object [object Object] has no method 'get'


mainpanel.setActiveItem(panel4, { type: 'slide' });
}
}
},

clearSelectionOnDeactivate: true,
//layout: 'fit',
store: store,
itemTpl: '<div class="contact2"><strong>{firstName}</strong> {lastName}</div>',


grouped: false,
indexBar: true,
singleSelect: true,
selModel: {
mode: 'SINGLE',
allowDeselect: true
}


}]


});
var panel4=new Ext.Panel({
dockedItems:[{
dock: 'top',
xtype: 'toolbar',
title:'Home',
items:[{
ui: 'back', text: 'Previous',

handler: function () {
mainpanel.setActiveItem(panel1, { type: 'slide' });
}
}]
}]
});
}
});
i want to display details of selected name(in list) from panel1 in panel4 using the above code.but error is coming...

mitchellsimoens
16 Nov 2011, 8:46 AM
Cannot read your code very well, please wrap in code tags.