如何改变在sencha touch 2中列表中分组标题的背景颜色? [英] How to change the background color of the grouped heading in List in sencha touch 2?

查看:229
本文介绍了如何改变在sencha touch 2中列表中分组标题的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个有2个组的列表。我想覆盖列表中给定的组的标题的默认背景颜色。如何在sencha touch 2中更改列表中分组标题的背景颜色?

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?

推荐答案

将cls添加到列表中,如

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
}

添加以下css样式

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

根据模型值更改页眉颜色this 可能会给您一个想法。

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

这篇关于如何改变在sencha touch 2中列表中分组标题的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆