{ "id": "63866", "key": "TIMOB-3234", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-02T20:12:18.000+0000", "created": "2011-04-15T03:40:06.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T21:19:14.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": "{html}
Overview
\r\nWhen creating custom dashboard items that don't correspond to\r\nthe \"hard coded\" size restrictions within the Dashboard Module,\r\nevents associated with the Dashboard Items are not fired in the\r\ncorrect spots or at all.
\r\nTechnical Information
\r\nTitanium Mobile SDK: 1.5.x and above
\r\nEnvironment: iPad Simulator
\r\niOS SDK: 4.1 && 4.2
\r\nExpected Result:
\r\nClicking on the Dashboard Item should fire the coded Event
\r\nActual Result:
\r\nEvent is not fired at all or is triggered in the wrong place
\r\nCode Sample:
\r\n\r\n\r\nvar win = Ti.UI.currentWindow;\r\n\r\nvar data = [\r\n {id: 0, title: 'test1', image:'image.png'},\r\n {id: 1, title: 'test2', image: 'image.png'},\r\n {id: 2, title: 'test3', image:'image.png'},\r\n {id: 3, title: 'test4', image:'image.png'},\r\n {id: 4, title: 'test5', image:'image.png'},\r\n {id: 5, title: 'test6', image:'image.png'},\r\n {id: 6, title: 'test7', image:'image.png'},\r\n {id: 7, title: 'test8', image:'image.png'},\r\n {id: 8, title: 'test9', image:'image.png'},\r\n {id: 9, title: 'test10', image:'image.png'},\r\n {id: 10, title: 'test11', image:'image.png'},\r\n {id: 11, title: 'test12', image:'image.png'},\r\n {id: 12, title: 'test13', image:'image.png'}\r\n];\r\n\r\n\r\nvar background = Ti.UI.createView({\r\n backgroundImage: '../images/bkg.png'\r\n});\r\n\r\nvar dashboardItems = [];\r\nvar t = 0;\r\nfor(var i=0, j=data.length; i < j; i++){\r\n \r\n var label = Ti.UI.createLabel({\r\n text: data[i].title,\r\n font: {\r\n fontSize: 12,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'bold' \r\n },\r\n shadowColor: '#333',\r\n shadowOffset: {x:1, y:1},\r\n color: '#fff',\r\n width: 130,\r\n textAlign: 'center',\r\n top: 210\r\n });\r\n \r\n var icon = Ti.UI.createImageView({\r\n image: '../images/'+ data[i].image,\r\n width: 130,\r\n height: 'auto'\r\n });\r\n \r\n var item = Ti.UI.createDashboardItem({\r\n title: data[i].id,\r\n canDelete: false,\r\n top: t,\r\n width: 140,\r\n height: 230,\r\n zIndex: 100,\r\n touchEnabled: true\r\n });\r\n \r\n item.addEventListener('click', function(e){\r\n //This never gets hit - event isn't getting called\r\n Ti.API.info('HELLOOO');\r\n });\r\n \r\n item.add(icon);\r\n item.add(label);\r\n dashboardItems.push(item); \r\n \r\n //Goofy stuff i have to do to make custom Dashboard Items show properly on the iPad in landscape mode\r\n if((i+1) % 3 == 0) { \r\n if( i % 8 == 0) { t=0; Ti.API.info('Top: '+t); continue;}\r\n t+=125; \r\n Ti.API.info('Top: '+t);\r\n Ti.API.info('Mod: '+ i%3);\r\n }\r\n\r\n // Debug Info for the DashboardItem positioning\r\n Ti.API.info('Top: '+t);\r\n Ti.API.info('Mod: '+ i%3);\r\n}\r\n\r\nvar dasboard = Ti.UI.createDashboardView({\r\n title: 'dashboard',\r\n data: dashboardItems,\r\n touchEnabled: true,\r\n wobble: false,\r\n height: 768,\r\n width: 900,\r\n top: 10\r\n});\r\n\r\nwin.add(background);\r\nwin.add(dashboard);
\r\n