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

TableView swiping in star rating

$
0
0

I would like users of my app to be able to swipe right on a row in a table view and present a star rating for them to click

My current implementation is below but is not showing my v2 view on the row and I'm not sure why

The listener is setup like

var current_row;
 
$.drillBrowseTable.addEventListener('swipe', function(e){
    current_row = Ti.Platform.osname == 'android' ? this : e.row; // it looks like android does not have the e.row property for this event.
 
    current_row.hide();
    current_row.v2.visible = true;
    current_row.v2.show();
    console.log('swiping' + e.rowData.drill_id);
});
The adding of v2 to the row is setup like
var row = Ti.UI.createTableViewRow({height: 80, hasChild: true, drill_id: json["drills"][i]["id"]});
 
var drillName = Ti.UI.createLabel({text: json["drills"][i]["name"], top: 10, left: 105, font: { fontSize:12, fontWeight: 'bold' }});
 
row.add(drillName);
 
row.v2 = Ti.UI.createView({
  width: Ti.UI.FILL,
  height: Ti.UI.FILL,
  backgroundColor: '#ff0000', //just to make the effect apparent
  visible: false
}); 
 
row.add(row.v2);
 
tableData.push(row);
And in my console I can see the log entry being displayed which confirms the swipe is being captured [INFO] : swiping540

Any guidance would be greatly appreciated


Viewing all articles
Browse latest Browse all 8068

Trending Articles



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