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

Update A Label In ListView

$
0
0

Hello,

I just converted my TableView to a ListView in order to deal with the jittery nature of TableView with many rows each containing ImageViews and scrolling.

So far the ListView looks more promising. However, I am wondering how I would update a Label that is in a ListView?

For example, previously I stored the reference to the Label in an array and updated the .text field.

Here is how I add my items to my ListView section with id = "alertsSection"

function addNewAlertToListView(alert)
{
    var alertData = [];
 
    for(var i = 0; i < 20; ++i)
    {
        alertData.push({
            template : 'alertTemplate',
            'alertImage' : {
                image : AlertUtils.factionNameToImage(alert.faction)
            },
            'alertLabel' : {
                text : alert.title          
            }
        });
    }
 
    $.alertsSection.setItems(alertData);
}
Is there a way to update the 'alertLabel' text without recreating the data set again?

Thank you.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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