Uploaded image for project: 'Documentation'
  1. Documentation
  2. TIDOC-164

APIDoc: UI.TableView and TableViewRow- document supported events per platform

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: Release 1.8.0.1
    • Fix Version/s: Release 2.0.0, Sprint 2012-02
    • Component/s: APIDoc
    • Environment:
      • Titanium 1.9.0 (2012/02/09 14:46 6d0363b)
      • Android 2.2 Emulator
      • iOS5 Simulator

      Description

      The event Titanium.UI.TableViewRow.longpress is iOS-only, due to the linked ticket.

      Test Case

      See inline comments for results of functional tests on each platform

      TableView

      app.js

      var win = Ti.UI.createWindow({
      	backgroundColor: 'white',
      	fullscreen: false
      });
       
      var data = [];
       
      for(var i=0;i<20;i++){
      	var	thisRow = Ti.UI.createTableViewRow({
      		height:100,
      		className:'rows',
      		touchEnabled:false
      	});
       
      	var label = Ti.UI.createLabel({
      		text: 'Row '+i,
      		touchEnabled:false
      	});
       
      	thisRow.add(label);
      	data.push(thisRow);
      }
       
      var tableView = Ti.UI.createTableView({
      	data: data
      });
       
      // android
      // ios
      tableView.addEventListener('click', function(e) {
          Ti.API.info('Click event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('dblclick', function(e) {
          Ti.API.info('dblclick event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('doubletap', function(e) {
          Ti.API.info('doubletap event heard from ' + e.source);
      });
       
      // android
      tableView.addEventListener('longclick', function(e) {
          Ti.API.info('longclick event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('longpress', function(e) {
          Ti.API.info('longpress event heard from ' + e.source);
      });
       
      tableView.addEventListener('pinch', function(e) {
          Ti.API.info('pinch event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('singletap', function(e) {
          Ti.API.info('singletap event heard from ' + e.source);
      });
       
      // ios
      // android
      tableView.addEventListener('scroll', function(e) {
          Ti.API.info('scroll event heard from ' + e.source);
      });
       
      // ios
      // android
      tableView.addEventListener('scrollEnd', function(e) {
          Ti.API.info('scrollEnd event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('swipe', function(e) {
          Ti.API.info('swipe event heard from ' + e.source);
      });
       
       
      tableView.addEventListener('touchcancel', function(e) {
          Ti.API.info('touchcancel event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('touchend', function(e) {
          Ti.API.info('touchend event heard from ' + e.source);
      });
       
       
      tableView.addEventListener('touchmove', function(e) {
          Ti.API.info('touchmove event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('touchstart', function(e) {
          Ti.API.info('touchstart event heard from ' + e.source);
      });
       
      // ios
      tableView.addEventListener('twofingertap', function(e) {
          Ti.API.info('twofingertap event heard from ' + e.source);
      });
       
      win.add(tableView);
      win.open();
      

      TableViewRow

      app.js

      var win = Ti.UI.createWindow({
      	backgroundColor: 'white',
      	fullscreen: false
      });
       
      var data = [];
       
      var tableView = Ti.UI.createTableView();
       
      tableView.addEventListener('click', function(e) {
          Ti.API.info('Click event heard from ' + e.source);
      	if (e.index === 0) {
      		tableView.deleteRow(e.index);
      	}
      });
      	
      for(var i=0;i<20;i++){
      	var	thisRow = Ti.UI.createTableViewRow({
      		height:100,
      		className:'rows'
      	});
       
      	var label = Ti.UI.createLabel({
      		text: 'Row '+i,
      		touchEnabled:false
      	});
       
      	// android
      	// ios
      	thisRow.addEventListener('click', function(e) {
      	    Ti.API.info('Click event heard from ' + e.source);
      	});
      	
       
      	thisRow.addEventListener('dblclick', function(e) {
      	    Ti.API.info('dblclick event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('doubletap', function(e) {
      	    Ti.API.info('doubletap event heard from ' + e.source);
      	});
       
      	thisRow.addEventListener('delete', function(e) {
      	    Ti.API.info('delete event heard from ' + e.source);
      	});
      	
      	// android
      	thisRow.addEventListener('longclick', function(e) {
      	    Ti.API.info('longclick event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('longpress', function(e) {
      	    Ti.API.info('longpress event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('pinch', function(e) {
      	    Ti.API.info('pinch event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('singletap', function(e) {
      	    Ti.API.info('singletap event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('scroll', function(e) {
      	    Ti.API.info('scroll event heard from ' + e.source);
      	});
       
      	thisRow.addEventListener('scrollEnd', function(e) {
      	    Ti.API.info('scrollEnd event heard from ' + e.source);
      	});
      		
      	thisRow.addEventListener('swipe', function(e) {
      	    Ti.API.info('swipe event heard from ' + e.source);
      	});
      	
      	
      	thisRow.addEventListener('touchcancel', function(e) {
      	    Ti.API.info('touchcancel event heard from ' + e.source);
      	});
       
      	// ios
      	thisRow.addEventListener('touchend', function(e) {
      	    Ti.API.info('touchend event heard from ' + e.source);
      	});
      	
      	thisRow.addEventListener('touchmove', function(e) {
      	    Ti.API.info('touchmove event heard from ' + e.source);
      	});
       
      	// ios
      	thisRow.addEventListener('touchstart', function(e) {
      	    Ti.API.info('touchstart event heard from ' + e.source);
      	});
      		
      	thisRow.addEventListener('twofingertap', function(e) {
      	    Ti.API.info('twofingertap event heard from ' + e.source);
      	});
       
      	thisRow.add(label);
      	data.push(thisRow);
      }
       
      tableView.setData(data);
       
       
      win.add(tableView);
      win.open();
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pdowsett Paul Dowsett
                Reporter:
                pdowsett Paul Dowsett
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration