admin管理员组文章数量:1391937
i would like to make some of my entries in a Combobox italic.
Is there something like the renderer of a Column or how can i achive this?
Edit: Sorry but i didn't provide enough information, and i'm realizing that this is nonsense what i wanted do before...
I will write some more words to this atfter i pletely understand my problem...
i would like to make some of my entries in a Combobox italic.
Is there something like the renderer of a Column or how can i achive this?
Edit: Sorry but i didn't provide enough information, and i'm realizing that this is nonsense what i wanted do before...
I will write some more words to this atfter i pletely understand my problem...
Share Improve this question edited Aug 11, 2011 at 11:41 Sebastian asked Aug 11, 2011 at 11:21 SebastianSebastian 4302 gold badges8 silver badges18 bronze badges 1- You need to mention how you are calling bobox or store? – Kiran Commented Aug 11, 2011 at 11:25
2 Answers
Reset to default 5If you just want to style the list items itself it's sufficient to provide a getInnerTpl()
function for the internal bound list used in the dropdown:
var bo = new Ext.form.field.ComboBox({
// ...
listConfig: {
getInnerTpl: function() {
return '{field1}: {field2}';
}
},
// ...
});
If you'd like to change the whole content of the dropdown, provide a tpl
parameter in the listConfig
:
var bo = new Ext.form.field.ComboBox({
// ...
listConfig: {
tpl: '<div><tpl for="."><span class="item">{field1}: {field2}</span></tpl></div>',
itemSelector: 'span.item' // you need to provide an itemSelector if you change the template
},
// ...
});
As Tanel Tähepõld suggested, you should read the documentation for Ext.XTemplate
.
Ext.form.field.ComboBox has config property "renderTpl", you can create your own Ext.XTemplate and use it (html markup). XTemplate also allows to use if caluses inside template so you can create if caluse for italic text. Doc for Ext.XTemplate: http://docs.sencha./ext-js/4-0/#/api/Ext.XTemplate
本文标签: javascriptExtJs ComboBox style entriesStack Overflow
版权声明:本文标题:javascript - ExtJs ComboBox: style entries - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744690209a2619949.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论