Results 1 to 5 of 5

Thread: 'Records' URL Variable Messes up my Get When Saving a Store

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Location
    Atlanta, Georgia
    Posts
    40

    Default 'Records' URL Variable Messes up my Get When Saving a Store

    When I save a store, a URL variable called "records" is screwing up the get. How do I remove this variable? I don't want to parse it out on the server.

  2. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Is this for when you do a sync?
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Location
    Atlanta, Georgia
    Posts
    40

    Default

    I'm doing a save:

    Code:
    StoryProxy.prototype.updateStory = function(record) {
        console.log('StoryProxy.prototype.updateStory');
        this.previousStory = this.currentStory;
        this.currentStory = record;
        
        var storyStore = Ext.StoreMgr.lookup('storyStore');
        var recordToUpdate = storyStore.getById(record.getId());
        
        recordToUpdate.set('entry_title', record.entry_title);
        recordToUpdate.set('html_text', record.html_text);
        
        // These are the records that will be saved
        console.dir(storyStore.getUpdatedRecords());
        //storyStore.sync();
        storyStore.save();
        
    };

  4. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,451

    Default

    Are you using a writer? If the root config of the writer is undefined (as is default) then it shouldn't put a root.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Location
    Atlanta, Georgia
    Posts
    40

    Default

    Yeah:

    Code:
    Ext.define('Story', {
        extend:'Ext.data.Model',
        autoLoad:false,
        idProperty: 'entry_id',
        fields:[
            {name:'entry_title',type:'string'},
            {name:'entry_text',type:'string'},
            {name:'entry_id',type:'int'},
            {name:'entry_author_id',type:'int'},
            {name:'author_name',type:'string'},
            {name:'html_text',type:'string'}
            ],    
        proxy:{
            type:'jsonp',
            url:'http://www.somewhere.com',
            reader:{
                root:'results',
                totalProperty: 'totalCount'
            },
            writer: {
                writeAllFields: false,
                type: 'json'
            }
        },  
        belongsTo:'Book'     
    });

Posting Permissions

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