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
    8,883
    Vote Rating
    102
    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

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