-
30 Jul 2010 6:51 AM #1
[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.
-
30 Jul 2010 9:23 AM #2Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,659
- Vote Rating
- 14
Your issue has been entered in trac; thank you for the report.
-
3 Aug 2010 6:39 AM #3
Well
is a bug in v0.91 as far as I know.Code:user1.firstName
You should useinstead.Code:user1.get('firstName')
-
3 Aug 2010 7:27 AM #4
Dear jeroenvduffelen.
Thank you for your answer.
I also confirmed that your code is working with Sencha Touch 0.92.
-
4 Aug 2010 12:21 PM #5
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.
-
14 Aug 2010 5:18 AM #6
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!
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED-82](0.85) Ext.data.Connection.abort() & isLoading() : r.xhr is undefined
By watrboy00 in forum Sencha Touch 1.x: BugsReplies: 1Last Post: 28 Jun 2010, 2:51 PM -
Getting data from JsonStore to gererate GUI - data undefined
By paweluz in forum Ext 3.x: Help & DiscussionReplies: 2Last Post: 22 Jun 2010, 3:07 PM -
[FIXED][3.x] Ext.data.DataProxy cb undefined
By mjlecomte in forum Ext 2.x: BugsReplies: 1Last Post: 17 Apr 2009, 2:59 PM -
[FIXED][3.x] Ext.data.DataProxy cb undefined
By mjlecomte in forum Ext 3.x: BugsReplies: 1Last Post: 17 Apr 2009, 2:59 PM -
How do I send RAW POST DATA via the XML Data Model?
By steve.neill in forum Community DiscussionReplies: 4Last Post: 30 Nov 2006, 3:50 PM


Reply With Quote