1. #1
    Sencha User
    Join Date
    Dec 2009
    Location
    Lille
    Posts
    18
    Vote Rating
    0
    Trey is on a distinguished road

      0  

    Default Remove a record from a store

    Remove a record from a store


    Hi,
    I have a problem when I remove a record from a store. After a call to save(), the record is still in the store. A second call to save() send a second "remove record" to the server. I would have access to store.removed to remove definitively the record from the store.

    Code:
        var store = new Ext.data.Store(
        {
    ....
            proxy: MyProxy(
            {
                api: 
                {
                    .....
                    destroy: this.remove
                }
            })
        });
    
    
    
    Ext.extend(MyProxy, Ext.data.DataProxy, 
    {
    
        // protected
        doRequest: function(action, rs, params, reader, callback, scope, options) {
      var onSuccessCallback = function(){
          // Here I would remove the record from the store
      };
            switch (action) {
                case Ext.data.Api.actions.destroy:
                        // Send request to server
                        this.api[action].call(this, rs, onSuccessCallback);
                    break;
            }
        }
    });

  2. #2
    Ext User
    Join Date
    Aug 2009
    Posts
    588
    Vote Rating
    1
    Mike Robinson is on a distinguished road

      0  

    Default


    It seems likely to me that the server's response to the Delete request is not appropriate, such that the client-side Store is not removing the "deleted" record.

    If you look at the implementation of Store.save() you will see that it fires all three kinds of requests: "C"reate, "U"pdate and "D"elete. Each of those has a corresponding success-callback. Since you see "D"elete requests going out, you know that the Store understands your request to delete the records. But it's not accepting the host's response. Therefore it is not removing the records from itself ... quite rightly, I might add.

    The first thing to check, of course, is that the host's response is "successful." Then follow the request through "Store.execute" and the callback-functions that are established in your case.

    It's not a pleasant experience, this kind of troubleshooting, but you'll do it soon enough anyway. Fortunately, you only have to do it once.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar