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

Android: Wrong row index when using TableView with Ti.UI.SIZE and specifying row className

    Details

      Description

      Problem description

      row "index" value it's wrong when using tableViews, with Ti.UI.SIZE height property set, containing complex rows (rows that contain other components) with "className" property set.

      Steps to reproduce

      Run the sample code:

      var win = Ti.UI.createWindow({ backgroundColor: "#000", navBarHidden: true, layout: 'vertical', fullscreen: true });
       
      var table = Ti.UI.createTableView({
      	height: Ti.UI.SIZE
      });
       
      var data = [], row;
       
      for (var i = 0; i < 10; ++i) {
      	
      	row = Ti.UI.createTableViewRow({ height: 75, className: 'RowClass' });
      	row.add(Ti.UI.createLabel({ text: 'Row ' + i, left: 10, height: Ti.UI.FILL, width: Ti.UI.FILL }));
      	
      	data[i] = row;
      }
       
      table.setData(data);
       
      table.addEventListener('click', function(e) {
      	alert('Index: ' + e.index);
      });
       
       
      win.add(table);
       
      win.open();
      

      Click on any row except the last one. You should get alert dialog saying that index is 9. After first click example usually works fine (only first click generates wrong index), but sometimes it does not work (it seems that issue is random and sometimes index is 9 and sometimes index is the index of the row that was clicked). The only reliable information is that first click never generates right index.

      Not specifying 'height' value, setting it to 'auto' or if "className" property is commented out, everything works fine.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                krowley Karl Rowley
                Reporter:
                ivan.skugor Ivan Skugor
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Source Code