{ "id": "97388", "key": "TIMOB-9973", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "13573", "description": "Sprint 2012-15 API", "name": "Sprint 2012-15 API", "archived": true, "released": true, "releaseDate": "2012-07-30" }, { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-08-13T09:45:12.000+0000", "created": "2012-07-16T15:05:21.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "module_tableview", "parity", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [ { "id": "23903", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "90576", "key": "TIMOB-8795", "fields": { "summary": "iOS: index, row , rowdata and section property for longpress event in tableview", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2012-12-27T18:41:43.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Steps to reproduce: \r\n1. Run this code:\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n \r\nvar tableData = []\r\nvar s = 0;\r\nvar nRow = 0;\r\nfor(var i = 0; i < 100; i++){\r\n var createNewSection = (i + 1) % 10 == 9 || i == 0 ? true : false;\r\n createNewSection ? nRow = 1 : nRow++;\r\n tableData.push({\r\n title:'Row #' + nRow + ' Index #' + i + ' Section #' + s,\r\n customProp:'Hello World! #' + i,\r\n header: createNewSection ? 'Section #' + s++ : null\r\n });\r\n}\r\n \r\nvar table = Ti.UI.createTableView({\r\n data: tableData\r\n});\r\n \r\nwin.add(table);\r\n \r\ntable.addEventListener('longpress', function(e){\r\n Ti.API.info('Section: ' + e.section);\r\n if(e.row) \r\n {\r\n Ti.API.info('Row: ' + e.row);\r\n Ti.API.info('Row Data: ' + e.rowData);\r\n Ti.API.info('Index: ' + e.index);\r\n Ti.API.info('customProp: ' + e.rowData.customProp);\r\n }\r\n});\r\n \r\nwin.open();\r\n{code}\r\n\r\n2. Perform a long press on multiple sections. You will see: \r\n[INFO] Section: [object TiUITableViewSection]\r\n[INFO] Row: [object TiUITableViewRow]\r\n[INFO] Row Data: [object TiUITableViewRow]\r\n[INFO] Index: 0\r\n[INFO] customProp: Hello World! #0\r\n\r\nprinted for each and every section, which is inccorect. Row and all its data should be null if longpress is performed on a table section.", "attachment": [], "flagged": false, "summary": "iOS: Incorrect properties returned by TableView's longpress event.", "creator": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "208320", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/2597", "updateAuthor": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-07-18T10:25:48.000+0000", "updated": "2012-07-18T10:25:48.000+0000" }, { "id": "210368", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2012-07-28T04:58:54.000+0000", "updated": "2012-07-28T04:58:54.000+0000" }, { "id": "210369", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "Ok so here is an example that shows how slow it gets.\r\n- it s already not so smooth on 2.1.0.GA but still very \"scrollable\"\r\n- it s drastically slower on 2.2.0 (master)\r\n- you wont see it on simulator!!! the problem appears on device (mine is an iphone 4).\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n \r\nfunction createRow(c) {\r\n var row = Ti.UI.createTableViewRow();\r\n row.selectedBackgroundColor = '#fff';\r\n row.height = 100;\r\n row.className = 'datarow';\r\n row.clickName = 'row';\r\n \r\n var photo = Ti.UI.createView({\r\n backgroundImage:'user.png',\r\n top:5,\r\n left:10,\r\n width:50,\r\n height:50,\r\n clickName:'photo'\r\n });\r\n row.add(photo);\r\n \r\n \r\n var user = Ti.UI.createLabel({\r\n color:'#576996',\r\n font:{fontSize:16,fontWeight:'bold', fontFamily:'Arial'},\r\n left:70,\r\n top:2,\r\n height:30,\r\n width:200,\r\n clickName:'user',\r\n text:'Fred Smith '+c\r\n });\r\n \r\n row.filter = user.text;\r\n row.add(user);\r\n \r\n var fontSize = 16;\r\n if (Titanium.Platform.name == 'android') {\r\n fontSize = 14;\r\n }\r\n var comment = Ti.UI.createLabel({\r\n color:'#222',\r\n font:{fontSize:fontSize,fontWeight:'normal', fontFamily:'Arial'},\r\n left:70,\r\n top:21,\r\n height:50,\r\n width:200,\r\n clickName:'comment',\r\n text:'Got some fresh fruit, conducted some business, took a nap'\r\n });\r\n row.add(comment);\r\n \r\n var calendar = Ti.UI.createView({\r\n backgroundImage:'/KS_nav_ui.png',\r\n bottom:2,\r\n left:70,\r\n width:32,\r\n clickName:'calendar',\r\n height:32\r\n });\r\n row.add(calendar);\r\n \r\n var button = Ti.UI.createView({\r\n backgroundImage:'KS_nav_views.png',\r\n top:35,\r\n right:5,\r\n width:36,\r\n clickName:'button',\r\n height:34\r\n });\r\n row.add(button);\r\n \r\n var date = Ti.UI.createLabel({\r\n color:'#999',\r\n font:{fontSize:13,fontWeight:'normal', fontFamily:'Arial'},\r\n left:105,\r\n bottom:5,\r\n height:20,\r\n width:100,\r\n clickName:'date',\r\n text:'posted on 3/11'\r\n });\r\n row.add(date);\r\n \r\n var toolbar = Ti.UI.createView ({\r\n bottom:0,\r\n right:0,\r\n height:38,\r\n width:200,\r\n backgroundColor:'#55000000',\r\n visible:false\r\n });\r\n var decale = 0;\r\n for (var i=0;i<6;i++)\r\n {\r\n var button = Ti.UI.createButton({\r\n right:decale,\r\n image:'KS_nav_views.png',\r\n width:38\r\n });\r\n toolbar.add(button);\r\n decale += 40;\r\n }\r\n \r\n row.add(toolbar);\r\n \r\n row.showToolbar = function()\r\n {\r\n toolbar.startLayout();\r\n toolbar.visible = true;\r\n toolbar.finishLayout();\r\n }\r\n \r\n row.hideToolbar = function()\r\n {\r\n toolbar.startLayout();\r\n toolbar.visible = false;\r\n toolbar.finishLayout();\r\n }\r\n \r\n row.switchToolbar = function(){\r\n toolbar.startLayout();\r\n toolbar.visible = !toolbar.visible;\r\n toolbar.finishLayout();\r\n }\r\n \r\n return row;\r\n}\r\n \r\nvar data = [];\r\nvar lastRow = 150;\r\nfor (var c=0;c