Hello, I am using for my project Ti.DrawerLayout by ricardoalcocer. I've got the view category.js created and added to the drawer in index.js:
var controls = require('controls'); var categoryView = controls.getCategoryView(); $.drawer.drawermainview.add(categoryView.getView());controls.js
exports.getCategoryView = function () { return Alloy.createController('category'); }; exports.getSecondView= function () { return Alloy.createController('second'); };I'm trying to create another view in category.js and replace it in the drawer when button in category.js is clicked, but i cant access $.drawer.drawermainview from category.js. Can anyone help me?
category.js
var controls = require('controls'); $.btn.addEventListener('click', function(e){ replaceSecondView(); }); function replaceSecondView() { var secondView=controls.getSecondView(); $.drawer.drawermainview.add(secondView.getView()); }
System: OSX 10.10, Titanium 3.5.2. GA
Thanks in advance,
Brudzio