Results 1 to 6 of 6

Thread: [FIXED]Models and Stores

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext JS Premium Member
    Join Date
    May 2008
    Posts
    321
    Vote Rating
    205
      0  

    Default [FIXED]Models and Stores

    When I run below code I get

    me.getProxy() is undefined

    Code:
    Ext.regModel('User', {
        fields: [{
            name: 'id',
            type: 'int'
        }, {
            name: 'name',
            type: 'string'
        }],
        proxy: {
            type: 'rest',
            url: 'ajaxresponse.jsp',
            reader: {
                type: 'json',
                root: 'users'
            }
        }
    
    });
    
    var test = new Ext.data.Store({
        id: 'dataStore',
        model: 'User'
    });
    
    var User = Ext.ModelMgr.getModel('User');
    
    var ed = new User({
        name : 'Ed Spencer',
        age : 25
    });
    
    
    ed.save({
        success: function(ed) {
            console.log("Saved Ed! His ID is "+ ed.getId());
        }
    });

  2. #2
    Ext JS Premium Member
    Join Date
    Oct 2009
    Posts
    29
    Vote Rating
    3
      0  

    Default

    sg707,

    Intuitively your way should work, but I think we're actually meant to do it this way, according to docs I read:

    var ed = Ext.ModelMgr.create({name : 'Ed Spencer', age : 25}, 'User');

  3. #3
    Sencha User
    Join Date
    Oct 2009
    Location
    Bucharest, Romania
    Posts
    70
    Vote Rating
    0
      0  

    Default similar

    Looks like it's related to this. I bumped into it too and I think it might be a temporary issue in the preview...

  4. #4
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,965
    Vote Rating
    931
      0  

    Default

    Looks like a bug. The line should read:

    Code:
    Ext.data.Model.override({
        getProxy: function(){
            return this.self.proxy;
        }
    });
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #5
    Ext JS Premium Member Greendrake's Avatar
    Join Date
    Jul 2008
    Location
    New Zealand
    Posts
    200
    Vote Rating
    38
      0  

    Default

    Just have come across this bug too. The solution works, but the question is: how come this bug exists? Of course I don't suppose that you guys did not test model saving and wrote the docs on it only , but this is really weird.

  6. #6
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,965
    Vote Rating
    931
      0  

    Default

    There's a few things we need to clean up related to the new class system and how it works with the data model.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Similar Threads

  1. Stores and Models
    By dombroskib in forum Sencha Touch 1.x: Discussion
    Replies: 14
    Last Post: 6 Jan 2011, 12:44 PM
  2. Trying to understand Stores/Requests/Models/Proxies/Readers
    By dac0nvu in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 21 Oct 2010, 7:02 AM
  3. [FIXED-137] Only 2 events on data Stores?
    By jeroenvduffelen in forum Sencha Touch 1.x: Bugs
    Replies: 5
    Last Post: 15 Sep 2010, 8:52 PM
  4. Questions on Models/Stores and primary and foreign keys
    By jeronimo in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 22 Aug 2010, 5:59 PM
  5. Questions about Models, Stores, and dynamic Lists
    By jonathanstark in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 10 Aug 2010, 8:54 AM

Posting Permissions

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