{ "id": "132863", "key": "AC-1086", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-07-24T08:33:45.000+0000", "created": "2014-07-10T15:00:23.000+0000", "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "updated": "2016-03-08T07:37:26.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hello.\r\n\r\nSeems like if table view section is clicked, \"click\" event is not being fired (if table view row is clicked, it works fine).\r\n\r\n\r\nTo see this issue, run this code:\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#333',\r\n\ttop: 20\r\n});\r\n\r\nvar table = Ti.UI.createTableView();\r\n\r\nfunction createSection(name) {\r\n\tvar label = Ti.UI.createLabel({\r\n\t\ttext: name\r\n\t});\r\n\tvar wrapper = Ti.UI.createView({\r\n\t\theight: 40,\r\n\t\tbackgroundColor: '#fff',\r\n\t\topacity: 0.9\r\n\t});\r\n\twrapper.add(label);\r\n\r\n\tvar section = Ti.UI.createTableViewSection({\r\n\t\theaderView: wrapper\r\n\t});\r\n\r\n\treturn section;\r\n\r\n}\r\n\r\nfunction createRow() {\r\n\tvar row = Ti.UI.createTableViewRow({\r\n\t\theight: 100,\r\n\t\tbackgroundColor: '#c96'\r\n\t});\r\n\r\n\tvar label = Ti.UI.createLabel({\r\n\t\ttext: 'Testing ...'\r\n\t});\r\n\r\n\trow.add(label);\r\n\r\n\treturn row;\r\n}\r\n\r\nvar sections = [], section;\r\nfor (var i = 0; i < 10; i++) {\r\n\tsection = createSection('Section ' + i);\r\n\tsection.add(createRow());\r\n\tsections.push(section);\r\n}\r\n\r\ntable.setData(sections);\r\n\r\ntable.addEventListener('click', function() {\r\n\talert('on click');\r\n});\r\n\r\nwin.add(table);\r\n\r\nwin.open();\r\n{code}\r\n\r\n\r\nNot that this should work since \"click\" event is added to table view and it seems this kind of use case produces events on native application.", "attachment": [], "flagged": false, "summary": "Click on table view section doesn't produce click event", "creator": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "* iOS 7.1\r\n* TiSDK 3.2.2.GA\r\n* XCode 5.1.1\r\n* OSX 10.9.4", "comment": { "comments": [ { "id": "315583", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "Hi,\r\n\r\nYou had added 'click' event to the table view, so this event will only fired when a table row is clicked like doc mentioned. \r\nRef: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.TableView-event-click\r\n\r\nRegards,\r\nShuo", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-24T06:15:06.000+0000", "updated": "2014-07-24T06:15:06.000+0000" }, { "id": "315597", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Hello.\r\n\r\n\r\nI am aware of that, but could that be a bug?\r\n\r\nTableView view contains TableViewSection which contains TableViewRow. So, they are in parent - child relationship. Event should propagate from child elements to parent - right?\r\nSo, in my opinion, even TableViewSection should produce TableView event since TableViewSection is it's child.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-07-24T08:25:59.000+0000", "updated": "2014-07-24T08:25:59.000+0000" }, { "id": "315598", "author": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "body": "no, I don't think so. Based on your code, the \"section number\" area is a header view for each row, it should not be triggered. If you want add some events to header view, you should add it into specific view you want.", "updateAuthor": { "name": "sliang", "key": "sliang", "displayName": "Shuo Liang", "active": true, "timeZone": "Asia/Harbin" }, "created": "2014-07-24T08:32:28.000+0000", "updated": "2014-07-24T08:32:28.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }