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

1.8 Breaks tableView click events in some circumstances

    Details

      Description

      TableView click events don't work depending on how complex the rows are. Previous to the build referenced it worked fine (and also works in 1.7.2). Below is a sample to reliably reproduce.

      var createBGBox = function(view, height) {
          height = height || 40;
          var outerView = Ti.UI.createView({
              width: 'auto',
              height: view.size.height + height
          });
          
          var contentView = view;
          outerView.content = contentView;
          
          var defaults = {
              backgroundColor: "#e4e4e4", //"#c9d9df",
              opacity: 0.90,
              borderRadius: 7,
              borderWidth: 1,
              borderColor: "#FFFFFF",
              left: 5,
              width: 310,
              height: view.size.height + (height - 10)
          };
          
          var bgView = Ti.UI.createView(defaults);
          
          var ds = Ti.UI.createImageView({
              image: 'KS_nav_ui.png',
              hires: true,
              top: bgView.size.height - 12,
              width: 320,
              left: 0
          });
          outerView.add(ds);
          
          outerView.add(bgView);
          outerView.add(contentView);
       
          return outerView;
      };
       
       
       
       var createCustomTableRow = function(obj) {
          var row = Ti.UI.createTableViewRow({
              className: 'eventdata',
              hasChild: true,
              height: 99,
              borderWidth:0,
              selectedBackgroundImage: 'none',
              selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
          });
       
          var txtView = Ti.UI.createView({
              layout: 'vertical',
              width: 'auto',
              height: 'auto',
              left: 115
          });
       
          var contentView = Ti.UI.createView({
              width: 'auto',
              height: 'auto'
          });
       
          var titleLBL = Ti.UI.createLabel({
              text: obj.name,
              height: 'auto',
              width: 170,
              left: 5,
              font: {
                  fontSize: 15,
                  fontWeight: 'bold'
              }
          });
          txtView.add(titleLBL);
       
          contentView.add(txtView);
             
          var view = createBGBox(contentView);
          row.add(view);
          row.height = view.size.height;
       
          return row;
      };
       
       
      var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
       
      var data = [
      	createCustomTableRow({
      		name: 'Test Row Data'
      	}),
      	createCustomTableRow({
      		name: 'Test Row Data'
      	}),
      	createCustomTableRow({
      		name: 'Test Row Data'
      	}),
      	createCustomTableRow({
      		name: 'Test Row Data'
      	}),
      	createCustomTableRow({
      		name: 'Test Row Data'
      	}),
      	createCustomTableRow({
      		name: 'Test Row Data'
      	})
      ];
       
      var table = Ti.UI.createTableView({
          separatorStyle: Ti.UI.iPhone.TableViewSeparatorStyle.NONE,
          backgroundColor: 'transparent',
          top:'7%',
          data: data
      });
       
      table.addEventListener('click', function() {
      	alert('row clicked');
      })
       
      win.add(table);
       
      win.open();
      
      

        Attachments

          Activity

            People

            • Assignee:
              blainhamon Blain Hamon
              Reporter:
              rblalock Rick Blalock (Inactive)
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration