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

Show index in Android tableview

$
0
0

I’m currently developing an iOS and Android cross platform application. In that I want to show a TableView with some data and also I need to show the index. For that I used the following code:

var win = Ti.UI.createWindow({
        backgroundColor:'#ffffff'
    });
 
    // Create table view data
    var data = [
        {title:'Apple', header:'A'},
        {title:'Amos'},
        {title:'Alonzo'},
        {title:'Boy', header:'B'},
        . . .
        {title:'Zinga', header:'Z'},
    ];
 
    var tableView = Titanium.UI.createTableView({
        data:data
    });
 
    var index = [
        {title:'A',index:0},
        {title:'B',index:3},
        {title:'C',index:7},
        {title:'D',index:15},
        {title:'E',index:16},
        {title:'F',index:20},
        {title:'G',index:27},
        {title:'H',index:30},
        {title:'I',index:33},
        {title:'J',index:36},
        {title:'K',index:41},
        {title:'L',index:44},
        {title:'M',index:48},
        {title:'N',index:52},
        {title:'O',index:55},
        {title:'P',index:60},
        {title:'Q',index:64},
        {title:'R',index:67},
        {title:'S',index:70},
        {title:'T',index:77},
        {title:'U',index:80},
        {title:'V',index:82},
        {title:'W',index:87},
        {title:'X',index:90},
        {title:'Y',index:93},
        {title:'Z',index:100}
    ];
 
    tableView.index = index;
    win.add(tableView);
    win.open();
But the above code is only working in iOS. In android it is not showing any index. I checked the Appcelerator Document and found that the index property is only available for iOS. Is there anyway to achieve the same in Android ? I didn’t find anything useful in the documentation.

Please help me, thanks in advance.


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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