extjs html css,html - Extjs ComboBox - Change the CSS? - Stack Overflow

it's not possible using CSS alone but you can use XTemplates to do something similar.

I've done it like this:

Ext.onReady(function(){

var states = Ext.create('Ext.data.Store', {

fields: ['class', 'desc', 'policy', 'ac'],

data : [

{"class":"1", "desc":"Medical Bills", "policy":"41000", "ac":"1"},

{"class":"12", "desc":"One Time Payments", "policy":"41000", "ac":"1"},

{"class":"3", "desc":"Treatment", "policy":"41000", "ac":"1"}

]

});

// Create the combo box, attached to the states data store

Ext.create('Ext.form.ComboBox', {

fieldLabel: 'Class Description',

width: 400,

store: states,

queryMode: 'local',

valueField: 'class',

displayField: 'desc',

renderTo: Ext.getBody(),

listConfig: {

minWidth: 500,

tpl: new Ext.XTemplate(

'

Class
' +

'

Description
' +

'

Policy
'+

'

A/C
' +

'

  • ' +

'

' +

'

{class}
' +

'

{desc}
' +

'

{policy}
' +

'

{ac}
' +

'

'

)

}

});

});

Really, it should be done using an actual table but it seems (From what I've tried anyway) that the ComboBox needs the ul/li tags in order to work correctly.

If you want to see it in action, here's a JS Fiddle: http://jsfiddle.net/MzdqJ/3/

It doesn't look to great but that should just be a case of playing around with the CSS styles. The logic should work at least.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值