PDA

View Full Version : record passed in getDetailCard - where am I going wrong?



irocker
4 Feb 2011, 10:05 AM
Hi all,

I have a nested list with a getDetailCard function... it all works great as long as the data in the detail card is static, but I'm unclear how to reference the current record and pass it to a different model which will get the details for that record. I get an error on the line highlighted in blue "Object has no method 'get'":



getDetailCard: function(record, parentRecord) {
Ext.regModel('detail', {
fields: ['name', 'description'],
proxy: {
type: 'ajax',
url: 'details.php?id='+ record.get('id')
}
}) ;

return new Ext.Panel({
title: 'Detail',
html: crsdetail.description,
style: 'background: white',
styleHtmlContent: true,
scroll: 'vertical'


});
}


You can see the basic idea of what I'm trying to do... just not sure how to reference it. Thanks!

tomalex0
19 Feb 2011, 10:46 PM
try this


record.attributes.record.get('id')