1. #1
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Thumbs up [solved] Delay starting PollingProvider

    [solved] Delay starting PollingProvider


    I am using a polling provider with an interval of 300 seconds.

    Code:
    Ext.Direct.addProvider({
      id: 'poll',
      type: 'polling',
      url: 'poll.php',
      interval: 300000
    });
    Now, I would like to have the first poll request 300 seconds after page loading instead of directly after loading. My workaround is

    Code:
    Ext.Direct.getProvider('poll').disconnect();
    setTimeout("Ext.Direct.getProvider('poll').connect()", 300000);
    but I am wondering if there is a cleaner/better way to do this?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,176
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Ext adds on a couple of convenience methods to all functions within JavaScript one of them is defer.

    Defer allows you to defer/delay a functions execution and further specify what scope it will run in (the context of this) and any additional arguments you'd like to pass to it.

    Try this:
    Code:
    var dp = Ext.Direct.getProvider('poll');
    dp.disconnect();
    dp.connect.defer(30000, dp);
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext User
    Join Date
    Aug 2009
    Posts
    127
    Vote Rating
    0
    rblon is on a distinguished road

      0  

    Default


    thx, defer seems a useful extjs function I wasn't aware of

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi