{ "id": "63267", "key": "TIMOB-2635", "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-02T18:05:08.000+0000", "created": "2011-04-15T03:25:27.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:13:20.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}
Also the data array count is not incremented and when retrieving\r\nthe data property, it does not contain the items that were\r\nappended
\r\n\r\n// this sets the background color of the master UIView (when there are no windows/tab groups on it)\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\n//\r\n// create base UI tab and root window\r\n//\r\nvar win1 = Titanium.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar item = Ti.UI.createDashboardItem({badge:1, image: \"KS_nav_ui.png\" });\r\nvar dboard = Titanium.UI.createDashboardView( {\r\n top: 45,\r\n width: '100%',\r\n data:[item]\r\n});\r\n\r\n\r\nwin1.add(dboard);\r\nvar button = Titanium.UI.createButton( { title: \"populate\",height:35, top: 2, width: 100 } );\r\nbutton.addEventListener(\"click\", function (e) {\r\n var item2 = Ti.UI.createDashboardItem({badge:dboard.data.length, image: \"KS_nav_ui.png\" });\r\n Titanium.API.info(\"Button clicked\");\r\n dboard.setData([item2]);\r\n dboard.show();\r\n Titanium.API.info(\"dboard.data length \"+dboard.data.length);\r\n Titanium.API.info(\"dboard.data \" + dboard.data);\r\n});\r\nwin1.add(button);\r\nwin1.open();
\r\n
I'd like to second this bug ticket. Looking in the
\n/Library/Application\nSupport/Titanium/mobilesdk/osx/1.5.1/iphone/Classes/TiUIDashboardView.m
under line 50 the setData method
\n\n-(void)setData
:(id)args\n{
\n
\n\n\n\n
\n[self launcher];\n\nfor (TiUIDashboardItemProxy *proxy in args)\n{\n ENSURE_TYPE(proxy,TiUIDashboardItemProxy);\n [launcher addItem:proxy.item animated:NO];\n}
\n
\n\n\n\n\n
\n}\n
You'll notice that all it ever does is addItem to the\nLauncherView. You can't set DashboardView.data directly to\noverwrite the existing dashboard, all it will ever do is\nappend.