1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    6
    Vote Rating
    0
    ayachesouhail is on a distinguished road

      0  

    Default change ajax proxy url dynamically

    change ajax proxy url dynamically


    Hello, plz how can i change the url of an ajax proxy after a buttton click and refresh the list data. Thx

  2. #2
    Sencha - Services Team AndreaCammarata's Avatar
    Join Date
    Jun 2009
    Posts
    1,395
    Vote Rating
    23
    AndreaCammarata has a spectacular aura about AndreaCammarata has a spectacular aura about

      0  

    Default


    You first have to get the list store, so if you know its name:

    Code:
    var store = Ext.getStore('NAME');
    otherwise if you have the list component instance:

    Code:
    var store = list.getStore();
    Then you have to get the proxy and change its url:

    Code:
    store.getProxy().setUrl('NEW_URL');
    Finally reload the store:

    Code:
    store.load();
    Sencha Inc
    Andrea Cammarata, Solutions Engineer
    Owner at SIMACS

    @AndreaCammarata
    www.andreacammarata.com
    github: https://github.com/AndreaCammarata

    TUX components bundle for Sencha Touch 2.x.x
    https://github.com/AndreaCammarata/TUX


Thread Participants: 1