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
    197
    Vote Rating
    89
    sg707 is just really nice sg707 is just really nice sg707 is just really nice sg707 is just really nice sg707 is just really nice

      0  

    Default [FIXED]Models and Stores

    [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
    iesdeveloper is on a distinguished road

      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
    icflorescu is on a distinguished road

      0  

    Default similar

    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 - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,268
    Vote Rating
    692
    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


    Looks like a bug. The line should read:

    Code:
    Ext.data.Model.override({
        getProxy: function(){
            return this.self.proxy;
        }
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext JS Premium Member
    Join Date
    Jul 2008
    Location
    New Zealand
    Posts
    93
    Vote Rating
    3
    Greendrake is on a distinguished road

      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 - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,268
    Vote Rating
    692
    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


    There's a few things we need to clean up related to the new class system and how it works with the data model.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

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

Thread Participants: 4