Titanium JIRA Archive
Alloy (ALOY)

[ALOY-529] Alloy.createWidget() should recognize the 2nd parameter as either a widget controller name or argument object

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusResolved
ResolutionFixed
Resolution Date2013-02-23T03:33:40.000+0000
Affected Version/sAlloy 1.0.0
Fix Version/sAlloy 1.1.0, 2013 Sprint 04
ComponentsRuntime
Labelsn/a
ReporterTony Lukasavage
AssigneeUnknown
Created2013-02-21T16:11:35.000+0000
Updated2018-03-07T22:25:54.000+0000

Description

Alloy.createWidget() accepts 3 parameters: * *id* - the widget id to be created * *src* - the name of the widget controller to be used * *args* - the argument object to pass into the widget's controller It would be nice if the second parameter could also be recognized as the *args* in the case where the developer would like to use the default *src* or "widget". In short, these 2 calls would behave identically, and continue to bahave identically after this improvement:
var args = { customArg: 123, anotherOne: 'hi there' };

// current usage
Alloy.createWidget('com.my.widget', 'widget', args);

// proposed shorter usage
Alloy.createWidget('com.my.widget', args);

Comments

No comments

JSON Source