简体   繁体   English

在extjs 4组合框中显示多个字段的值

[英]display values of multiple fields in extjs 4 combobox

i have a store which has 3 fields:Name,age and phoneNo. 我的商店有3个字段:姓名,年龄和电话号码。 As of now in my combobox i just display the name ie dispalyField:'Name'.Is there a way,i can display all the 3 fields in the combobox. 到目前为止,在我的组合框中,我只显示名称,即dispalyField:'Name'。有没有办法,我可以在组合框中显示所有3个字段。

I tried using: 我尝试使用:

listConfig : {
  itemTpl : '{Name} {age} {phoneNo}'
}

but this shows all the 3 values together like this: 但这显示了所有三个值,如下所示:

John Smith 93831222
John Ford  44222456

i want it to be displayed like this in the combobox,one below the other: 我希望它在组合框中像这样显示,一个在另一个下面:

John 
Smith 
93831222
Ford  
44222456

so that i can select any one of these.Any help is highly appreciated...thanks 这样我就可以选择其中的任何一个。非常感谢您的帮助...谢谢

try this: 尝试这个:

listConfig : {
   getInnerTpl: function(){ return '{Name} - {age}<tpl if="age === null">undefined</tpl> - {phoneno}{email}'; }
}

you can add any html code in the template 您可以在模板中添加任何HTML代码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM