1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default Abort previous LoadableDataModel.loadPage calls

    Abort previous LoadableDataModel.loadPage calls


    When making multiple calls to loadPage (i.e. a user clicks twic) the previous call should be aborted before the next one is made to avoid a race condition where the second call returns before the first and when the first call returns it overwrites the second call's data.

  2. #2
    Ext JS Premium Member
    Join Date
    Mar 2007
    Posts
    122
    Vote Rating
    0
    kalebwalton is on a distinguished road

      0  

    Default


    Looks like it was one of those things that just didn't make it in as it only takes a few small changes to get it to work (copied the methods from another yui-ext object that already had them). I didn't capture it below but I also had to add "this.abort();" to the second line of the load method so it would abort the previous on every load.

    Code:
    YAHOO.ext.grid.LoadableDataModel.prototype.isLoading = function(){
      return this.transId ? true : false;
    };
    
    YAHOO.ext.grid.LoadableDataModel.prototype.abort = function(){
      if(this.isLoading()){
        YAHOO.util.Connect.abort(this.transId);
      }
    };

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Thanks, I added it.

Similar Threads

  1. Previous Progress Dialog
    By tony.summerville in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 6 Jun 2007, 8:35 AM
  2. setTimeout calls yui or yui-ext class member
    By dlibby00 in forum Ext 1.x: Help & Discussion
    Replies: 2
    Last Post: 7 Feb 2007, 8:27 AM
  3. Replies: 1
    Last Post: 23 Nov 2006, 9:08 PM
  4. Grid Editor - Get Previous Value
    By thejoker101 in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 9 Nov 2006, 7:13 AM
  5. Local YAHOO.ext.grid.LoadableDataModel.load()
    By manxomfoe in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 18 Oct 2006, 4:19 PM

Thread Participants: 1