-
16 Feb 2011 8:52 AM #1
[CLOSED]Model.load success callback params
[CLOSED]Model.load success callback params
According to Ext4 preview documentation, we should get the user object as parameter to success callback of Model.load method:
However, if you run the above example you get an undefined user variable.Code://get a reference to the User model class var User = Ext.ModelMgr.getModel('User'); //Uses the configured RestProxy to make a GET request to /users/123 User.load(123, { success: function(user) { console.log(user.getId()); //logs 123 } });
-
17 Feb 2011 6:34 AM #2
-
17 Feb 2011 9:25 AM #3
Got it now...
Got it now...
Thank you Pandaxia,
I've read your post and that entire thread (which I found quite entertaining).
I know that load can take a second operation parameter, I just didn't need it in the test above.
Anyway, I've rebuilt my test case and the example works perfectly if the server responds with:
In other words even if you're just trying to load a single entity, it still must be placed inside an array. Thought I should mention this because others may run into the same issue.Code:[ { "id": 123, "name": "Name of user 123", "email": "anemailaddress@gmail.com" } ]
Still, I was wondering, is this the intended behavior or will it be changed before the release?
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
success param in callback from store.load is false
By guys2008 in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 27 Dec 2011, 1:29 PM -
[CLOSED]Error in Ext.data.Model.load ?
By htammen in forum Ext:BugsReplies: 1Last Post: 7 Mar 2011, 8:48 PM -
add success property or callback to my own function
By pasblin in forum Ext 3.x: Help & DiscussionReplies: 1Last Post: 8 Sep 2009, 10:18 PM -
[2.x][CLOSED] Ext.data.MemoryProxy.load() and success=false
By Evolic in forum Ext 2.x: BugsReplies: 1Last Post: 12 Nov 2008, 7:00 AM


Reply With Quote