How to change the background color of the grouped heading in List in sencha touch 2?

隐身守侯 提交于 2019-12-11 09:35:46

问题


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:


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.



来源:https://stackoverflow.com/questions/11754632/how-to-change-the-background-color-of-the-grouped-heading-in-list-in-sencha-touc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!