Titanium / Alloy widgets and controllers -


i'm building application titanium sdk 3 using alloyslidermenu widget.

this widget reates slider menu facebook application. sounds easy use, i'm facing following issue.

in index.xml require widget.

in index.js of application, have following piece of code:

currentview = alloy.createcontroller('list').getview(); //ds slider menu id //contentview in main panel of menu $.ds.contentview.add(currentview); 

this opens 'list' view in main window of application.

the issue is, in list.js controller, have function supposed change $.ds.contentview content ith view on click action of button. i'm unable access $.ds.contentview list container , use object.

i've tried alloy.createwidget etc.. no way, won't work.

if problem scope, quick fix can used globals or cfg variables:

alloy.globals.someglobalobject = { key: 'value' }; alloy.globals.someglobalfunction = function(){};  var theobject = require('alloy').globals.someglobalobject; 

there id more information using variables here: http://docs.appcelerator.com/titanium/latest/#!/api/alloy

and if not resolve problem, can send parameters in json object when create controller like:

alloy.createcontroller('list', {         title : "unable login",         message : authdata.failurereason,         callback : callbackfunc     }).getview() 

maybe callback functions can out.


Comments