1. #1
    Ext User
    Join Date
    Sep 2008
    Posts
    15
    Vote Rating
    0
    longer is on a distinguished road

      0  

    Smile Updatng Grid with a new HttpProxy

    Updatng Grid with a new HttpProxy


    All,

    I've been using the com.extjs.gxt.ui.client.widget.grid.Grid object in a similar fashion to the example given in the http://www.extjs.com/explorer/#xmlgrid and everything works great during the initial data load.

    Is there a standard way to update the HttpProxy and have a new dataset display in the table? All my efforts to point the http proxy to a different XML file show a stubborn Grid that just displays the initial XML.

    My work around is to re-create a Grid with a new XMLReader, BaseListLoader, ListStore etc. which *has* to be the wrong approach but I can't get BaseListLoader.load() to recognize any changes to the http proxy.

    Maybe I am going about this all wrong so does anybody know how to update a grid with a new and different http request? Example somewhere?

    Thanks in advance for any help!


    .Chris

  2. #2
    Ext GWT Premium Member gslender's Avatar
    Join Date
    Mar 2008
    Location
    Brisbane, Australia
    Posts
    1,572
    Vote Rating
    2
    gslender is on a distinguished road

      0  

    Default


    What about store.removeAll() and the loader.load();

  3. #3
    Ext User
    Join Date
    Sep 2008
    Posts
    15
    Vote Rating
    0
    longer is on a distinguished road

      0  

    Default


    Quote Originally Posted by gslender View Post
    What about store.removeAll() and the loader.load();
    I tried calling removeAll on the store, no luck, removeAll doesn't seem to remove the proxy.

  4. #4
    Ext User
    Join Date
    May 2008
    Location
    Phoenix, AZ
    Posts
    223
    Vote Rating
    0
    posta07 is on a distinguished road

      0  

    Default


    This looks like something you'll have to implement yourself (Darrell, correct me if I'm wrong), although I doubt it would be too hard.

    Extend the HttpProxy class, and then add a method to mutate the 'initUrl' member variable.

    Let us know what you decide to go with...

    Cheers

  5. #5
    Ext User
    Join Date
    Sep 2008
    Posts
    15
    Vote Rating
    0
    longer is on a distinguished road

      0  

    Default


    I figured I would have to do something like this, it's unfortunate that this isn't more directly supported. I will post back what I end up doing and if it works of course.

    Thanks!

    .Chris

  6. #6
    Ext User
    Join Date
    Sep 2008
    Posts
    15
    Vote Rating
    0
    longer is on a distinguished road

      0  

    Default


    Changing the member variable in the HttpProxy class has no effect, I am going to read more of the source to figure out what the heck is going on.

    Anymore tips would be appreciated! Subclass code below

    .Chris

    public class DemographicHttpProxy<C, D> extends HttpProxy<C, D>{

    /**
    * Creates a new HttpProxy.
    *
    * @param builder the request builder
    */
    public DemographicHttpProxy (RequestBuilder builder) {
    super(builder);

    }

    public void setHttpProxyURL(String url){
    super.initUrl = url;
    }

    public String getHttpProxyURL(){
    return super.initUrl;
    }
    }

  7. #7
    Ext User
    Join Date
    Nov 2008
    Posts
    19
    Vote Rating
    0
    shermdog01 is on a distinguished road

      0  

    Default


    I used reconfigure to display updated data:

    grid.reconfigure(store, cm);

  8. #8
    Ext User
    Join Date
    Sep 2008
    Posts
    15
    Vote Rating
    0
    longer is on a distinguished road

      0  

    Default


    For me I had manually update the view, the reconfigure method doesn't call it for some reason. Works fine now.

    loader.load();
    grid.reconfigure(demographicStore,demographicCM);
    grid.getView().refresh(false);