Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8796] Android: index, row , rowdata and section property for longpress event in tableview

GitHub Issuen/a
TypeNew Feature
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2012-12-21T05:41:02.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sSprint 2012-14 API, Release 3.0.0
ComponentsAndroid
Labelsapi, module_tableview, qe-testadded
ReporterDevang Gandhi
AssigneeHieu Pham
Created2012-04-19T11:48:45.000+0000
Updated2017-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.

Comments

  1. Shawn Lipscomb 2012-04-19

    HD ticket: https://support.appcelerator.com/tickets/APP-843858
  2. Pedro Enrique 2012-06-04

  3. Pedro Enrique 2012-06-05

  4. Neeraj Gupta 2012-06-26

    We need to make sure that we check the behavior across Android, iOS and Mobile Web platforms before resolving this ticket.
  5. Hieu Pham 2012-07-10

    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();
       
  6. Tamila Smolich 2012-08-16

    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)
  7. Lee Morris 2017-03-24

    Closing ticket as fixed with reference to previous comments.

JSON Source