Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-529

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

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: Alloy 1.0.0
    • Fix Version/s: Alloy 1.1.0, 2013 Sprint 04
    • Component/s: Runtime
    • Labels:
      None

      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);
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tlukasavage Tony Lukasavage
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration