1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    11
    Vote Rating
    0
    chazzz2473 is on a distinguished road

      0  

    Default Auto refresh of a Grid Data

    Auto refresh of a Grid Data


    Hello everyone, i'm quite new to Ext GWT, and i'm trying to figure something out.

    In my app, I use a Grid to display some data which is loaded with a RpcProxy.
    The data of the grid may be changing on the Server side, and i need to refresh this list everytime it does.

    How can this be done in a clean way ? I couldn't find a way to refresh the list every X seconds, and I couldn't find a way to trigger the reload via a listener either.

    Thanks in advance for your help, and sorry for my English, I'm french
    Let me know if you need any more information.

    Chazzz

    Edit : Using 2.1.0, by the way

  2. #2
    Sencha Premium Member Roddarn's Avatar
    Join Date
    Apr 2009
    Posts
    20
    Vote Rating
    0
    Roddarn is on a distinguished road

      0  

    Wink


    Hi.

    You could use the timer to schedule a load. This should reload your store every 60 seconds.
    (It's not tested, so I guess there are bugs in my small example)


    Timer timer = new Timer() {
    public void run() {
    grid.getStore().getLoader().load();
    }
    };
    timer.schedule(1000 * 60);

  3. #3
    Sencha User
    Join Date
    Jan 2010
    Posts
    11
    Vote Rating
    0
    chazzz2473 is on a distinguished road

      0  

    Default


    Thanks a lot, that is exactly what i was looking for.

    Seems like if you want the timer to refresh itself like this :

    final Timer timer = new Timer() {
    public void run() {
    loader.load();
    schedule(1000);
    }
    };
    timer.schedule(1000);

    The loader needs to be final. No idea why though.

  4. #4
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    final, because the call of the loader in run is then later and thats why the loader object should not change any more.
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  5. #5
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    80
    Vote Rating
    0
    terciofilho is on a distinguished road

      0  

    Default


    Better:

    Code:
    final Timer timer = new Timer()
    {
    	public void run()
    	{
    		loader.load();
    	}
    };
    timer.scheduleRepeating(1000 * 60);

  6. #6
    Sencha User
    Join Date
    Sep 2010
    Posts
    16
    Vote Rating
    0
    uinewbie is on a distinguished road

      0  

    Default


    Hi, I have pretty much the same setup as the OP and have the timer working. However, is there a way to not use the timer and only refresh the Grid when there's an update on the server side? (i.e., push notification)

  7. #7
    Ext GWT Premium Member
    Join Date
    Jul 2009
    Posts
    80
    Vote Rating
    0
    terciofilho is on a distinguished road

      0  

    Default


    Sure you can, but you need a comet implementation. Take a look at: http://code.google.com/p/gwt-comet/

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