Results 1 to 7 of 7

Thread: Stop the server request from store ?

  1. #1
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Thumbs up [Solved]Stop the server request from store ?

    Hi all,

    I am having a tabpanel with the following tabs :-

    simple form in first panel (tab1)...
    grid in the second panel(tab 2)...

    now when I click on tab 2, grid starts loading data from server.

    However while the data in tab 2 is still getting loaded (grid waiting for server response), if user moves to tab 1, I want to stop that grid request immediately. (because the data being loaded is now useless to me)

    any suggestions ?

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    You'd have to go through a fair amount of layers to stop it, is it really that important?

    By the time the user has switched to tab1 the request has probably already completed.
    Evan Trimboli
    Twitter - @evantrimboli

  3. #3
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Default It is important...

    Yes this is important for me.... also i am fetching data using some complex database code and its really taking time to load Grid... I even had to increase the timeout for the url...

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    18,583
    Vote Rating
    873
      0  

    Default

    I'd suggest you have a look at the source for the store, it should go something like:

    store -> proxy -> connection.
    Evan Trimboli
    Twitter - @evantrimboli

  5. #5
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966
    Vote Rating
    15
      0  

    Default

    Try this:
    Code:
    Ext.Ajax.abort(store.proxy.activeRequest);
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


  6. #6
    Ext User ritesh.kapse's Avatar
    Join Date
    May 2008
    Location
    Pune, India
    Posts
    120
    Vote Rating
    0
      0  

    Thumbs up thanks :)

    Thanks hendricd,

    your code worked... i had to unmask the grid explicitly though...

    hears the code :-

    Code:
     Ext.Ajax.abort(searchStore.proxy.activeRequest);                                
                                    var gMask = Ext.getCmp('searchGrid').loadMask;
                                    if(typeof gMask == 'object'){
                                        gMask.hide();
                                    }

  7. #7
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966
    Vote Rating
    15
      0  

    Default

    @ritesh.kapse -- Careful, it may be null:

    Code:
     Ext.Ajax.abort(searchStore.proxy.activeRequest);                                
     var gMask = Ext.getCmp('searchGrid').loadMask;
      if(gMask && gMask.hide){  gMask.hide();  }
    "be dom-ready..."
    Doug Hendricks

    Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.


    Got Sencha licensing questions? Find out more here.


Posting Permissions

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