[TIMOB-2635] iOS: DashboardView.setData appears to just append data items to the array
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2017-05-02T18:05:08.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | api |
Reporter | Aaron K. Saunders |
Assignee | Ingo Muschenetz |
Created | 2011-04-15T03:25:27.000+0000 |
Updated | 2017-05-02T21:13:20.000+0000 |
Description
Also the data array count is not incremented and when retrieving the data property, it does not contain the items that were appended
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//
// create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({
backgroundColor:'#fff'
});
var item = Ti.UI.createDashboardItem({badge:1, image: "KS_nav_ui.png" });
var dboard = Titanium.UI.createDashboardView( {
top: 45,
width: '100%',
data:[item]
});
win1.add(dboard);
var button = Titanium.UI.createButton( { title: "populate",height:35, top: 2, width: 100 } );
button.addEventListener("click", function (e) {
var item2 = Ti.UI.createDashboardItem({badge:dboard.data.length, image: "KS_nav_ui.png" });
Titanium.API.info("Button clicked");
dboard.setData([item2]);
dboard.show();
Titanium.API.info("dboard.data length "+dboard.data.length);
Titanium.API.info("dboard.data " + dboard.data);
});
win1.add(button);
win1.open();
I'd like to second this bug ticket. Looking in the
/Library/Application Support/Titanium/mobilesdk/osx/1.5.1/iphone/Classes/TiUIDashboardView.m
under line 50 the setData method
You'll notice that all it ever does is addItem to the LauncherView. You can't set DashboardView.data directly to overwrite the existing dashboard, all it will ever do is append.
Also, a feature request to be able to add and remove items programatically. A helpdesk ticket is asking for this: http://support-admin.appcelerator.com/display/APP-556514 Suggested methods: - dashboard.addItem( ); - dashboard.removeItem( );
Confirmed with SDK 2.2.0.014b86f
Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.