Results 1 to 3 of 3

Thread: How does store... proxy: { type: ajax, api: work?

  1. #1

    Default Answered: How does store... proxy: { type: ajax, api: work?

    How does
    Code:
    Ext.onReady(function(){
        Ext.tip.QuickTipManager.init();
        var store = Ext.create('Ext.data.Store', {
            model: 'Writer.Person',
            autoLoad: true,
            autoSync: true,
            proxy: {
                type: 'ajax',
                api: {
                    read: 'app.php/users/view',
                    create: 'app.php/users/create',
                    update: 'app.php/users/update',
                    destroy: 'app.php/users/destroy'
                },
    ... work? Does the sync function just do a compare between the gui instance of the data and the store in memory, and then based on differences it finds, decide what operation to perform? I'm trying to get a 'destroy' to work, and it tries to use either create or update....


    I'm using [CODE]objStorekv.remove(objStorekv.getAt(value));[CODE] in my delete function, and operation.action always = 'update'. What gives?

    many thanks in advance!
    DS
    Last edited by [email protected]; 17 Oct 2011 at 9:53 AM. Reason: add more info

  2. So a Store loads using the read. If you add a record to that store, when you do a sync() it will fire off (and batch) all the new records using the create. If you edit existing records (not new ones), it will use the update. If you remove a record from the store, it will use the destroy.

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

    Default

    So a Store loads using the read. If you add a record to that store, when you do a sync() it will fire off (and batch) all the new records using the create. If you edit existing records (not new ones), it will use the update. If you remove a record from the store, it will use the destroy.
    Mitchell Simoens @LikelyMitch

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

    Posts are my own, not any current, past or future employer's.

  4. #3

    Default

    that's my problem
    I'm using
    Code:
    objStorekv.remove(objStorekv.getAt(value));
    in my delete function, and operation.action always = 'update'.

Posting Permissions

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