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

ListView, hide value in template listview

$
0
0

Hello all again,

I have a listview and need to have data hidden in my listview template in order to use it for calculation.

How can I do to hide it in my template to not show the order value ?

Thanks

Here's my example

var data = [
    { rowtitle: { title: 'Black',   order :'1'} },
    { rowtitle: { title: 'White',   order :'2'} },
    { rowtitle: { title: 'Red',   order :'3'} }
];
 
var win = Ti.UI.createWindow({backgroundColor: 'white'});
 
var myTemplate = {
    childTemplates: [
        {
            type: 'Ti.UI.Label', // Use a label
            bindId: 'rowtitle',  // Bind ID for this label
            properties: {        // Sets the Label.left property
                left: '10dp'
            }
        }, 
 
// GET THE ORDER VALUE BUT KEEP IT HIDDEN FROM 
 
 
 
    ]
};
 
 // Add the list data items to a section
var listSection = Titanium.UI.createListSection({items: data});
 
// Add the list section to a list view
var listView = Titanium.UI.createListView({});
 
var listView = Ti.UI.createListView({
    templates: { 'myTemplate': myTemplate },
    defaultItemTemplate: 'myTemplate',
    sections: [listSection]          
});
 
listView.addEventListener('click', function(e) {
    alert('index : ' + e.itemIndex);
});
 
win.add(listView);
win.open();

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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