[TIMOB-8796] Android: index, row , rowdata and section property for longpress event in tableview
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2012-12-21T05:41:02.000+0000 |
| Affected Version/s | Release 2.1.0 |
| Fix Version/s | Sprint 2012-14 API, Release 3.0.0 |
| Components | Android |
| Labels | api, module_tableview, qe-testadded |
| Reporter | Devang Gandhi |
| Assignee | Hieu Pham |
| Created | 2012-04-19T11:48:45.000+0000 |
| Updated | 2017-03-24T21:20:53.000+0000 |
Description
Just like the click event in TI.UI.Tableview, customer wants index,row,rowdata and section property for longpress event.
HD ticket: https://support.appcelerator.com/tickets/APP-843858
We need to make sure that we check the behavior across Android, iOS and Mobile Web platforms before resolving this ticket.
Test code:
var win = Ti.UI.createWindow(); var tableData = [] var s = 0; var nRow = 0; for(var i = 0; i < 100; i++){ var createNewSection = (i + 1) % 10 == 9 || i == 0 ? true : false; createNewSection ? nRow = 1 : nRow++; tableData.push({ title:'Row #' + nRow + ' Index #' + i + ' Section #' + s, customProp:'Hello World! #' + i, header: createNewSection ? 'Section #' + s++ : null }); } var table = Ti.UI.createTableView({ data: tableData }); win.add(table); table.addEventListener('longpress', function(e){ Ti.API.info('Section: ' + e.section); Ti.API.info('Row: ' + e.row); Ti.API.info('Row Data: ' + e.rowData); Ti.API.info('Index: ' + e.index); if (e.rowData != null) { Ti.API.info('customProp: ' + e.rowData.customProp); } }); win.open();Closing as fixed. Tested and verified on: Titanium Studio, build: 2.1.1.201208091713 Titanium SDK, build: 2.2.0.v20120816015712 Devices: Nexus 7 tab (4.1.1), HTC Evo (4.0.3), iPhone 4 (4.3.5)
Closing ticket as fixed with reference to previous comments.