Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    dendy is on a distinguished road

      0  

    Default how to clear proxy 'cache' or something like that ..

    how to clear proxy 'cache' or something like that ..


    hello

    i have problem.. 2 days i'm searching in doc and googling but can't find solution .. can please somebody help me ?

    i have a TreeGrid, connected to store using Direct proxy with api CRUD method calls using JsonRPC

    i'm adding new node with this :

    Code:
      var row = store.getAt(this.rowIndex);
        
       // update row
       row.set({ name: 'blablabla'; });
      
       // or insert new child :
       row.appendChild({ node });
    TreeStore is defined with :
    Code:
        autoLoad: true,
        autoSync: true,
        autoDestroy: true,    
        clearOnLoad: true,
        clearRemovedOnLoad: true,
    until at server side everythng runs ok, and server returns success:true, everything is OK.. But problem is when server returns exception, so node wasn't added ... i'm catching exception in proxy :

    Code:
     ... proxy code...
     listeners: {
        exception: function(me, response, operation, eOpts ) { 
           // display error mesasge that something is wrong 
        } 
     }
    But .. here starts 2 basic problems :

    1/ Node, which i tried to add with row.set(), is still visible in grid tree (even when he was not physically saved at server side - it dissappears only when i reload whole grid.. what i understand about how treegrid works - i need somehow tell to grid to 'remove' this displayed node or at least reload it's parent node)

    2/ When i trigger again some update after such unsuccessfull action, which ends with exception on this grid (i edit or add some other node), then store/proxy re-sends again with new request data also data of previous request which endend with exeption .. so istead of :

    Code:
    { data of new request }
    store sends

    Code:
    [ {data of old request}, {data of new request} ]
    it looks it is still somewhere cached because it didn't ended with success: true, and it is send again and again with any new request .. What is really strange is, that it doesn't work just for appendChild() call .. for row.set(), there is no such issue ...

    I'm really desperate

    Any help appreciated..

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    dendy is on a distinguished road

      0  

    Default


    i made small step forward and solved the problem 1/ .. i added this one :

    Code:
    Ext.data.TreeStore.implement(
    {
    	revertUnsavedChanges: function()
    	{
    		Ext.each(this.getNewRecords(), function(record) {
    			this.load({node: record.parentNode });
    		});
    
    
    
    
    		Ext.each(this.getUpdatedRecords(), function(record) {
    			this.load({node: record.parentNode });
    		});
    
    
    
    
    		Ext.each(this.removed, function(record){
    			this.load({node: record.parentNode });
    		});        
    	}
    });
    then i call in proxy -> listeners -> exeption simply this.revertUnsavedChanges()

    this reloads parent where node was edited / added / removed unsucessfully, so the wrong node disapeears from list .. maybe dirty solution but works for me

    but problem 2/ is still there ..

  3. #3
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    dendy is on a distinguished road

      0  

    Default


    i moved little bit forward with my problem.. now i need trivial thing, but no idea how to do it :-(

    in proxy exception listener, i call store.getNewRecords() to get list of all records which were not correctly sycned .. now i need somehow CLEAR this list (with autoSync turned off - clear them only at client side, so store will not contact server)

    any idea how to do this ??

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    4
    Vote Rating
    0
    dendy is on a distinguished road

      0  

    Default


    problem solved .. i added record.commit() to getNewRecords() loop and now it works fine...

  5. #5
    Sencha User
    Join Date
    Oct 2010
    Location
    St. Louis, Missouri
    Posts
    40
    Vote Rating
    3
    caballero is on a distinguished road

      0  

    Default more info please

    more info please


    Denny, if you could explain to me how to clear the records in the getNewRecords list, I would be your new best friend.

    I've been struggling with this for too long.

    How can i clear these on exception?
    I don't understand where the commit() comes in?

    If you could post a little more code in a follow up, it would be much appreciated.

Thread Participants: 1

Tags for this Thread