PDA

View Full Version : displayField Combo



LaZag
9 Jan 2012, 10:01 PM
Hi,

I would like display more than one field as displayField. Like : "Name (id)"
For example in using :

{...
displayField : 'name' ('id'),
...}

Thank you for your help

Lazag

Farish
10 Jan 2012, 3:29 AM
This will help you to display more than 1 field when you open the combo list but only one is shown (which you have in the displayField when the combo list is collapsed...



displayField: field1,
listConfig: {
getInnerTpl: function() {
return '{field1} {field2}';
}
}

LaZag
10 Jan 2012, 8:11 AM
Thank you very much for your reply.
I Know this way to display more than one field when the combo is opened, but i would have the same result when the combo is closed.
Thank you by advance.

Lazag

skirtle
11 Jan 2012, 8:24 AM
You could set a custom displayTpl. If the combobox is non-editable that might work.

It might be safer just to create a composite field in your store though.

LaZag
11 Jan 2012, 12:44 PM
Thank you very much !
I'm using displayTpl :

...
displayTpl: '<tpl for=".">{name} ({id})</tpl>',
...

Lazag