PDA

View Full Version : NestedPanel -> customAttribute and getDetailcard



Dig4Fire
11 Sep 2010, 3:14 PM
Hello,

how to get the value of customAttribute in panel html? Please take a look at the code.


Ext.regModel('Cards', {
fields: [
{name: 'text', type: 'string'},
{name: 'customAttribute', type: 'string'}
]
});

Ext.setup({
icon: 'icon.png',
tabletStartupScreen: 'tablet_startup.png',
phoneStartupScreen: 'phone_startup.png',
glossOnIcon: false,
onReady: function(){

var store = new Ext.data.TreeStore({
model: 'Cards',
proxy: {
type: 'ajax',
url: 'cc.php?frob='+getParam("frob"),
reader: {
type: 'tree',
root: 'items'
}
}
});

var nestedList = new Ext.NestedList({
fullscreen: true,
title: 'CoboCards',
displayField: 'text',
store: store,
getDetailCard: function(record, parentRecord) {

var panel = new Ext.Panel({
fullscreen: true,
floating: true,
modal: true,
html: 'test', // <--------------------------- customAttribute
styleHtmlContent: true,
scroll: 'vertical',
cls: 'htmlcontent',
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
text: 'Close',
handler: function () {
panel.hide();
}

}]
}]

}).show();
}
});
}
});

evant
11 Sep 2010, 7:45 PM
[code
html: record.get('customAttribute');
[/code]

Dig4Fire
12 Sep 2010, 12:41 AM
Thank you, "record.get is not a function", but "html: record.attributes.record.data.customAttribute" works. It was too late last night :)