Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-9973

iOS: Incorrect properties returned by TableView's longpress event.

    Details

      Description

      Steps to reproduce:
      1. Run this 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);
          if(e.row) 
          {
              Ti.API.info('Row:        ' + e.row);
              Ti.API.info('Row Data:   ' + e.rowData);
              Ti.API.info('Index:      ' + e.index);
              Ti.API.info('customProp: ' + e.rowData.customProp);
          }
      });
        
      win.open();
      

      2. Perform a long press on multiple sections. You will see:
      [INFO] Section: [object TiUITableViewSection]
      [INFO] Row: [object TiUITableViewRow]
      [INFO] Row Data: [object TiUITableViewRow]
      [INFO] Index: 0
      [INFO] customProp: Hello World! #0

      printed for each and every section, which is inccorect. Row and all its data should be null if longpress is performed on a table section.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                hpham Hieu Pham
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5387
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code