Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-13927] iOS: TableView Swipe event doesn't contain row or rowData

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-19T21:34:26.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 13 API, 2013 Sprint 13, Release 3.1.4, Release 3.2.0
ComponentsiOS
Labelsdocumentation, module_tableview, qe-testadded, tableView, triage
ReporterMitchell Amihod
AssigneeVishal Duggal
Created2013-05-20T19:07:36.000+0000
Updated2013-10-16T07:22:59.000+0000

Description

http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.TableView-event-swipe Properties lists row, rowData. These are not available, as you can see in attached app.js Assuming this is a docs problem - though i'd prefer this be a code issue, as I could really use that info in the swipe event on a tableview.

Attachments

FileDateSize
app.js2013-05-20T19:07:36.000+0000513
Screen Shot 2013-05-21 at 11.33.05 AM.png2013-05-21T15:39:47.000+0000153504

Comments

  1. Daniel Sefton 2013-05-20

    Teseted and confirmed on iOS 6 simulator with Ti SDK 3.1 GA and 3.2 CI. The following output is displayed:
       [INFO] :   ->swipe {
       [INFO] :       bubbles = 1;
       [INFO] :       cancelBubble = 0;
       [INFO] :       direction = left;
       [INFO] :       source = "[object TiUITableView]";
       [INFO] :       type = swipe;
       [INFO] :       x = 255;
       [INFO] :       y = 209;
       [INFO] :   }
       
    I will escalate this to engineering rather than docs and they can decide whether this is a docs issue.
  2. Daniel Sefton 2013-05-20

    Android output (correct):
       I/TiAPI   ( 1577):  ->swipe {"type":"swipe","source":{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},"detail":false,"index":2,"direction":"left","cancelBubble":false,"rowData":{"backgroundRepeat":false,"title":"Row"},"row":{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},"section":{"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"rowCount":12,"children":[],"keepScreenOn":false,"size":{"height":0,"y":0,"width":0,"x":0},"rows":[{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"touchEnabled":false,"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false},{"bubbleParent":true,"rect":{"height":0,"y":0,"x":0,"width":0},"size":{"height":0,"y":0,"width":0,"x":0},"children":[],"backgroundRepeat":false,"title":"Row","keepScreenOn":false}]},"y":118,"x":174.4083709716797,"bubbles":true}
       
  3. Mitchell Amihod 2013-05-21

    thanks daniel.
  4. Tim Poulsen 2013-05-21

    Also missing is index.
  5. Tim Poulsen 2013-05-21

    Screenshot of simulator showing code & properties of event object
  6. Stephen Feather 2013-05-21

    Confirm that this does not work on 3.0.0.GA Do not have a system I can roll back to test on 2.1.x. Swipe on the row also appears broken. Specifying each row individually, or passing as an array to setData() no difference.
       var win = Ti.UI.createWindow({backgroundColor: '#262626'});
       var row0 = Ti.UI.createTableViewRow({title: 'Ti.version: '+ Ti.version});
       var row1 = Ti.UI.createTableViewRow({title: '1'});
       // row1.addEventListener('swipe', function(e){
       // 	alert('row swipe event fired: '+JSON.stringify(e));
       // });
       var tableView = Ti.UI.createTableView({height: '100%', width: '100%'});
       tableView.appendRow(row0);
       tableView.appendRow(row1);
       tableView.addEventListener('click', function(e){
       	alert('click event fired: '+JSON.stringify(e));
       });
       
       tableView.addEventListener('swipe', function(e){
       	alert('swipe event fired: '+JSON.stringify(e));
       });
       win.add(tableView);
       win.open();
       
       
  7. Stephen Feather 2013-05-21

    Broken on 2.1.4GA !http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/cda2fbea-6e94-48f2-9288-70a3bcf4cd74/00000881.png!
  8. Stephen Feather 2013-05-21

    Broken on 2.0.1GA, last sdk I can build with on this system. !http://content.screencast.com/users/Stephen_Feather/folders/Jing/media/76b0d6a5-cfa8-40af-9039-82f4f1399e4a/00000882.png!
  9. Vishal Duggal 2013-06-19

    Expanded test case with Search
       var win = Ti.UI.createWindow();
       
       
       var data = [];
       
       
       for 
           (var i = 1; i <= 50; i++) {
           var row = Ti.UI.createTableViewRow({title: 'ROW '+i});
           data.push(row);
       };
       
       var search = Titanium.UI.createSearchBar({
               barColor:'#385292',
               showCancel:false,
               hintText:'search'
           });
       
       search.addEventListener('return', function(e)
       {
           search.blur();    
       });
       search.addEventListener('cancel', function(e)   
       {
           search.blur();
       });
       
       var table = Ti.UI.createTableView({
           data:data,
           search:search,
           searchHidden:true,
           hideSearchOnSelection:false,
           height:'80%'
       })
       
       win.add(table);
       
       
       table.addEventListener('swipe', function(e){
           if (e.row != undefined) 
           {
               Ti.API.info('swipe event fired: '+e.x+' '+e.y+' '+e.direction+' '+e.search+' '+e.index+' '+JSON.stringify(e.row));
           } else 
           {
               Ti.API.info('swipe event fired: '+e.x+' '+e.y+' '+e.direction+' '+e.search);
           }
       });
       
       var hide = Ti.UI.createButton({
           title:'HIDE',
           bottom:0,
           left:0
       })
       
       var show = Ti.UI.createButton({
           title:'SHOW',
           bottom:0,
           right:0
       })
       
       win.add(hide);
       win.add(show);
       
       hide.addEventListener('click',function(){
           table.searchHidden = true;
       })
       
       show.addEventListener('click',function(){
           table.searchHidden = false;
       })
       win.open();
       
  10. Vishal Duggal 2013-06-19

    Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4404
  11. Mark Ross 2013-09-09

    Why isn't this fixed included in 3.1.3? I need this functionality so I downloaded 3.1.3.v20130908095038 and then realized it never made it to that codebase. How can I get this fix in an SDK without jumping to 3.2.0?
  12. Vishal Duggal 2013-09-10

    @[~mross@qtags.com], You could just cherry pick this PR into your own 3_1_X branch and build a custom SDK.
  13. Fokke Zandbergen 2013-09-23

    This really should be merged back to 3_1_X, with 3_2_X not expected before dec right?
  14. Stephen Feather 2013-09-23

    Wow, Vishal. 'Roll your own'? 'Cherry pick'? While that is a TECHNICALLY accurate response, it is a highly IMPRACTICAL response to an end user. 'I'm sorry sir, we forgot to put wheels on your new car, here is a welding torch, you can add it yourself'. I'm with Fokke, this needs pushed into a supplemental 3.1.x release.
  15. Fokke Zandbergen 2013-09-23

    [~sfeather], here you are... 3.1.3.GA with the fix: http://we.tl/FWBwFt4XDN
  16. Stephen Feather 2013-09-23

    Fokke, thanks. That should help anyone else that stumbles across this cluster. We rolled ours this morning. Its the engineer's 'attitude' towards end users that irks me. Not all titanium users are setup to compile the sdk themselves.
  17. Ingo Muschenetz 2013-09-23

    [~sfeather] While I agree that this could have been communicated better, we try to keep the list of items we pull onto the CI 3.1.X branches relatively small in order to keep that branch as stable as possible. It's not possible for us to backport everything--we attempt to backport items that broadly affect everyone, and encourage users to backport fixes that meet their specific needs where they can't wait for the next major release. We will review pulling this into 3.1.X. That said, I would like it if it were straightforward for users to self-patch the SDK. Suggestions are appreciated.
  18. Paras Mishra 2013-10-15

    Row data is contained in the swipe event. Verified fix on: Device : iPod Touch , iOS version : 6.1.3 Device : iPhone 5 , iOS version : 7.0 SDK: 3.2.0.v20131013140318 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310112258 XCode : 5

JSON Source