Hybrid View

  1. #1
    Ext JS Premium Member gevik's Avatar
    Join Date
    May 2009
    Location
    The Netharlands
    Posts
    265
    Vote Rating
    8
    gevik will become famous soon enough

      0  

    Question using "new" or Ext.createWidget

    using "new" or Ext.createWidget


    Hi,

    In the examples, the Ext.creatdWidget method is used instead of the "new" keyword. Is this the way to go forward?

    I understand that ClassManager->instantiateByAlias internally will load the required classes and signal for ready. But, is Ext.creatdWidget also appropriate for production environments? Especially when ext-all.js will be included in the page?

    Regards,
    Gevik

  2. #2
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    There are many benefits of using Ext.widget() (Ext.createWidget() will be deprecated in the next release) that we will be revealing through in-depth tutorials in the coming weeks. Beside the convenience of instantiating by xtype (no need to remember the full class name), it enables dynamic dependency resolution behind-the-scene to ensure the corresponding class is loaded the first time it's instantiated.

    Again we decided to delay introduction of Ext.Loader until the next release, so that we have more time to prepare good documentation. Stay tuned
    Sencha Touch Lead Architect

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Location
    Haarlem, Netherlands
    Posts
    1,243
    Vote Rating
    9
    TommyMaintz will become famous soon enough TommyMaintz will become famous soon enough

      0  

    Default


    To answer your question in short, yes, it would be better to use Ext.widget instead of new Widget going forward. There will be more benefits in the long term then just enabling dynamic loading.

Similar Threads

  1. "passing google maps gevents to extjs" or "simulate mouse click"
    By thomas.oberthanner in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 11 Aug 2011, 6:06 AM
  2. Replies: 3
    Last Post: 28 Oct 2009, 6:38 AM
  3. Replies: 8
    Last Post: 11 Sep 2008, 9:00 AM
  4. replace the "south" with the "new Ext.StatusBar" in "layout:'border'"
    By ealpha in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 May 2008, 8:28 PM

Thread Participants: 2