Problem
Would like to be able to dynamically set the dataCollection for a UI element. In this way we can use a single view/controller to output a different collection of data.
Test case
var tab = null;
exports.openMainWindow = function(_tab,_title,_collection){
tab = _tab;
$.win.title = _title;
var collection = Alloy.Collections[_collection];
collection.fetch();
$.tab.dataCollection = collection;
_tab.open($.win);
}
var goNext = function(e){
if(e.source.custom.length>0){
var subControl = Alloy.createController(e.source.custom);
} else if(e.source.nextCollection.length>0) {
var subControl = Alloy.createController('table');
subControl.openMainWindow(tab,e.source.title,e.source.nextCollection);
}
}
$.tab.addEventListener('click', goNext);
Discussions
http://developer.appcelerator.com/question/150685/dynamic-collection-for-view#comment-167341
No comments