PDA

View Full Version : TreePanel with more than one field in displayField



anderson.resendes
26 Mar 2012, 12:33 PM
Hello

I have a treepanel and I would like to set the displayField with two fields, id and name, for example, "CODE 01 - Primeiro item". Someone can help me?


Thanks

vietits
26 Mar 2012, 3:08 PM
You can use renderer


columns: [{
xtype: 'treecolumn', //this is so we know which column will show the tree
text: 'Code - Name',
dataIndex: 'id',
renderer: function(value, metaData, record){
return record.get('id') + ' - ' + record.get('name');
}
....