Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Jul 2010
    Location
    Kanagawa, Japan
    Posts
    12
    Vote Rating
    0
    taka_2 is on a distinguished road

      0  

    Default [FIXED-187] The model data become undefined.

    [FIXED-187] The model data become undefined.


    // Set up a model to use in our Store
    Ext.regModel('User', {
    fields: [
    {name: 'firstName', type: 'string'},
    {name: 'lastName', type: 'string'}
    ]
    });

    var user1 = Ext.ModelMgr.create({firstName: 'hoge1', lastName: 'moge1'}, 'User');
    document.write(user1.firstName);


    Running the code using Sencha Touch 0.91, "hoge1" will be displayed.
    But running the code using Sencha Touch 0.92, "undefined" will be displayed.
    Appears to have failed to initialize the model.

  2. #2
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Your issue has been entered in trac; thank you for the report.

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Posts
    64
    Vote Rating
    0
    jeroenvduffelen is on a distinguished road

      0  

    Default


    Well
    Code:
    user1.firstName
    is a bug in v0.91 as far as I know.

    You should use
    Code:
    user1.get('firstName')
    instead.

  4. #4
    Ext User
    Join Date
    Jul 2010
    Location
    Kanagawa, Japan
    Posts
    12
    Vote Rating
    0
    taka_2 is on a distinguished road

      0  

    Default


    Dear jeroenvduffelen.

    Thank you for your answer.

    I also confirmed that your code is working with Sencha Touch 0.92.

  5. #5
    Ext User
    Join Date
    Jul 2010
    Posts
    7
    Vote Rating
    0
    flashape is on a distinguished road

      0  

    Default


    I was just coming to post this same issue. It works by using the method jeroenvduffelen mentioned, but if it's wrong to do "obj.prop" then it shouldn't be in the examples.

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,050
    Vote Rating
    657
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    The examples have been updated so they use record.get.

    Also, if you want to access the raw property, you'd use

    Code:
    user1.data.firstName;
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Similar Threads

  1. Replies: 1
    Last Post: 28 Jun 2010, 2:51 PM
  2. Getting data from JsonStore to gererate GUI - data undefined
    By paweluz in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 22 Jun 2010, 3:07 PM
  3. [FIXED][3.x] Ext.data.DataProxy cb undefined
    By mjlecomte in forum Ext 2.x: Bugs
    Replies: 1
    Last Post: 17 Apr 2009, 2:59 PM
  4. [FIXED][3.x] Ext.data.DataProxy cb undefined
    By mjlecomte in forum Ext 3.x: Bugs
    Replies: 1
    Last Post: 17 Apr 2009, 2:59 PM
  5. How do I send RAW POST DATA via the XML Data Model?
    By steve.neill in forum Community Discussion
    Replies: 4
    Last Post: 30 Nov 2006, 3:50 PM

Thread Participants: 4