1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    28
    Vote Rating
    0
    Answers
    1
    Edward Lu is on a distinguished road

      0  

    Default Answered: How to change the selected item color for the list?

    Answered: How to change the selected item color for the list?


    Hello,

    I have several cards that display several different lists. When the item in the list has been selected, the background color in the selected item will be changed to default blue. How can I change the background color for selected item in each list in each card?

    My code is (for one list)

    { xtype: 'list',
    store: 'mystore',
    itemTpl: '<div class="x-list-normal, x-list-item,x-item-selected, x-list-item-label" style="background-color:white">{myvariable in the list} </div>'
    }

    This doesn't work, the selected item always has the default blue color in backgroud.

    P.S. I want to change in different colors, not only one which is default blue to something.

    Anyone has any suggestions? Thanks.

    Edward

  2. You'll be able to do this through the theming framework:

    http://www.sencha.com/learn/theming-sencha-touch/

    Specifically, you'll want to change the listitemselect class thusly

    Code:
    .listitemselect {
       background: $my_new_gradient;
       text-shadow: $my_new_stunning_effect;
    }
    To have a different color on different lists, you'll have to set up a cls within each config object afaik.

  3. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    39
    Vote Rating
    3
    Answers
    3
    Rhoover is on a distinguished road

      0  

    Default


    You'll be able to do this through the theming framework:

    http://www.sencha.com/learn/theming-sencha-touch/

    Specifically, you'll want to change the listitemselect class thusly

    Code:
    .listitemselect {
       background: $my_new_gradient;
       text-shadow: $my_new_stunning_effect;
    }
    To have a different color on different lists, you'll have to set up a cls within each config object afaik.

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    28
    Vote Rating
    0
    Answers
    1
    Edward Lu is on a distinguished road

      0  

    Default


    Thank you Rhoover. I got it!

Thread Participants: 1