How to change the background color of the grouped

2019-07-29 09:36发布

I have a list with 2 groups. I want to override the default background color of the headings given to the group in the list. How to change the background color of the grouped heading in List in sencha touch 2?

1条回答
孤傲高冷的网名
2楼-- · 2019-07-29 09:46

You can easily do this by adding ur own class to the list and the find the class names that define the styles for the headers using the chrome developer tools.

Add cls to the list like

{
    xtype: 'list',
    itemTpl: '<div class="contact2"><strong>{firstName}</strong> {lastName}</div>',
    disclosure: true,
    grouped: true,           
    cls:'customHeader',
    store: store
}

Add the following css style

.customHeader .x-list-header {
    background-color: red;
    background-image: none;
    border-color: red;
    color: beige;
}

To change the header color based on model value this Sencha Fiddle, JSFiddle might give you an idea.

查看更多
登录 后发表回答