Multiple Selection from a list
Hi All,
I am having some problem to get a multiple selection list to be rendered with the some custom list elements. Is there any way to accomplish this for Appcelerator Android Application.
1 Answer
-
I'm aware that this was asked over a year ago, however I had the same problem and since this post came up in my search I thought I'd provide an answer.
below is a simplified version of code to produce a list capable of multiple selections.
win.add(sizeTable = Ti.UI.createTableView({allowSelection:true})) data = [ {title:'X small', selected:false, backgroundColor:'#fff'}, {title:'small', selected:false, backgroundColor:'#fff'}, {title:'medium', selected:false, backgroundColor:'#fff'}, {title:'large', selected:false, backgroundColor:'#fff'}, {title:'X large', selected:false, backgroundColor:'#fff'}, {title:'XX large', selected:false, backgroundColor:'#fff'} ] sizeTable.data = data sizeTable.addEventListener('click',function(e){ e.rowData.selected = !e.rowData.selected if(e.rowData.selected){ e.rowData.backgroundColor = "#64b1fc" } else { e.rowData.backgroundColor = "#fff" } })
I'm assuming thats the kind of thing the original poster was after…