When I create an instance of Titanium.UI.DashboardItem and push it to a data array for inclusion in a Titanium.UI.DashboardView instance, I'm able to easily listen to click events of each DashboardItem. However, if I add any view to the DashboardItem, no click events are registered for the DashboardItem or any of the children views. Because events aren't occurring, I'm not able to navigate to the intended content associated with each item.
Unfortunately, adding child views to DashboardItem seems like the only way I can add text to a DashboardItem, as well as stylize the icons to have rounded corners (other than editing the images themselves).
Here is my code. If you spot anything I'm missing, I'd appreciate the feedback.
_dashboardItem = Titanium.UI.createDashboardItem({ canDelete: false }); _iconContainer = Titanium.UI.createView({ width: 70, height: 70, borderRadius: 10, backgroundColor: '#eee' }); _dashboardItem.add(_iconContainer); var _imageView = Titanium.UI.createImageView({ image: 'icons/icon.png', width: 57, height: 57 }); _iconContainer.add(_imageView); _dashboardItem.add(Titanium.UI.createLabel({ text: "title", textAlign: 'center', top: 45, height: 15, font: { fontSize: 13 } })); _dashboardItem.addEventListener("click", function(e){ Ti.API.info("DashboardItem clicked"); });