Results 1 to 3 of 3

Thread: Basic Question - extjs4. Ext.create vs Ext.define

  1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    65
    Answers
    1

    Default Answered: Basic Question - extjs4. Ext.create vs Ext.define

    Dear Experts,
    I am new to Extjs4. Currently learning it by experimenting and going through some tutorials. I have this very basic question.
    I would like to understand the what is the difference between Ext.create and Ext.define.

    I am wondering why my page works fine even without using Ext.create. I have just defined my Controller, views, models etc by using Ext.define and not created them anywhere explicitly using Ext.create, but still all the views are rendered correctly.

    Could you please explain the difference and usage of these two.
    I would highly appreciate it.

    Thanks,
    Rajesh

  2. Thanks Scott,
    That was what I was looking for.

    Thanks for the explanation.
    Rajesh

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,410
    Answers
    716

    Default

    Ext.create creates an instance.
    Ext.define defines the class itself

    You can create an instance of a class at anytime.
    In the MVC pattern, the instances are created based on your array setups

    Code:
    views : [ 'MyView' ] // creates an instance of that view
    store  : [ 'MyStore' ] // creates an instance of store

  4. #3
    Sencha User
    Join Date
    Aug 2013
    Posts
    65
    Answers
    1

    Default Good explanation!!

    Thanks Scott,
    That was what I was looking for.

    Thanks for the explanation.
    Rajesh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •