Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How can i change the background color of an listviewrecord dynamically when selected?

$
0
0

When a listviewrecord is clicked, i'm showing additional data in a seperate window. I want to change the backgroundcolor of the selected listitemrecord. This way i want to show which item was selected.

I know there is a selectedBackgroundColor attribute, it not doing what i want. This attribute is using backgroundcolor only when you actively select the item, on releasing your finger the color disappears again.

see my template below

<Templates>
                <ItemTemplate name="template">
                    <View class="recordcontainer">
                        <Label bindId="businessName" id="businessName" class="topline" />
                        <View id="adrescontainer">
                            <Label bindId="adres" id="adres" class="bottomline" />
                            ,
                        </View>
                    </View>
                </ItemTemplate>
            </Templates>
 
in my controller within the handler of itemclick event
 var item = $.mainsection.getItemAt(eo.itemIndex);
Setting backgroundcolor on the item is not working. how can i get reference to the record so that i can change the backgrouncolor.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>