1. #1
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default Pass parameters to Store with ajax proxy?

    Pass parameters to Store with ajax proxy?


    Hi,
    I am learning Ext JS 4, but I can't seem to find how to pass params to a store with ajax proxy?
    The examples don't show how to do this and there isn't a baseParams anymore.

    What's the trick here? I want to pass arbitrary key/values to the URL endpoint when loading from the store.

    thanks!

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    17
    Vote Rating
    0
    Rob Hogan is on a distinguished road

      0  

    Default


    I ran into this yesterday. The best solution I could find was to listen for 'beforeload' on the store and then alter operation.params. I don't think there's an equivalent to baseParams in Ext 4.

    Edit: On second thoughts.. the extraParams config option of the proxy looks like the one to use.

  3. #3
    Sencha User
    Join Date
    Dec 2008
    Location
    India
    Posts
    94
    Vote Rating
    0
    nikhilkrishnan is on a distinguished road

      0  

    Default


    store.proxy.extraParams={param:value}

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    294
    Vote Rating
    0
    Sesshomurai is on a distinguished road

      0  

    Default


    Thanks, I will try it.

    But in Ext 3 it was very handy to supply those params in the store.load without having to dig into the proxy reference etc....

  5. #5
    Sencha Premium Member
    Join Date
    May 2009
    Posts
    156
    Vote Rating
    9
    ZachG will become famous soon enough

      0  

    Default


    Code:
    store.load({
    	params:{
    		zach:"IS",
    		awesome:true
    	}
    });