Results 1 to 5 of 5

Thread: POST parameters in ajaxProxy

  1. #1
    Sencha User
    Join Date
    May 2013
    Posts
    18
    Answers
    1
    Vote Rating
    1
      0  

    Default Answered: POST parameters in ajaxProxy

    Hello every one

    How to add POST parameters in ajaxProxy when calling load store's method.

    Thanks in advence

  2. Do you mean you want some parameters on the URL and some in the request body for the same request?

    If you set the method to POST then the params will be used as post parameters. To add GET parameters too you could either bolt them onto the url yourself (either via the url config or maybe via an override of buildUrl if they're dynamic) or set some urlParams in an override of buildRequest. urlParams is an undocumented option for Ext.Ajax.request.

    I suggest that you study the code for Ext.data.Connection, Ext.data.proxy.Ajax and Ext.data.proxy.Server - that's all I'm doing to answer your questions.

  3. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585
    Vote Rating
    394
      0  

    Default

    To set the method to POST instead of GET for a load use actionMethods or override getMethod.

    To pass the parameters...

    You can pass parameters directly into the load method if you're calling it manually.

    You can use extraParams instead if they're fixed for all requests through the proxy.

    Use a beforeload listener on the store if you need to hook in dynamically. See the source to Ext.ux.grid.FiltersFeature for an example.

    Alternatively, you can do all kinds of magic if you write a proxy subclass:

    http://skirtlesden.com/articles/custom-proxies

  4. #3
    Sencha User
    Join Date
    May 2013
    Posts
    18
    Answers
    1
    Vote Rating
    1
      0  

    Default

    I want to have some parameters in GET method and some other in POST, is it possible ?

  5. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585
    Vote Rating
    394
      1  

    Default

    Do you mean you want some parameters on the URL and some in the request body for the same request?

    If you set the method to POST then the params will be used as post parameters. To add GET parameters too you could either bolt them onto the url yourself (either via the url config or maybe via an override of buildUrl if they're dynamic) or set some urlParams in an override of buildRequest. urlParams is an undocumented option for Ext.Ajax.request.

    I suggest that you study the code for Ext.data.Connection, Ext.data.proxy.Ajax and Ext.data.proxy.Server - that's all I'm doing to answer your questions.

  6. #5
    Sencha User
    Join Date
    May 2013
    Posts
    18
    Answers
    1
    Vote Rating
    1
      0  

    Default

    Ok, that's very interesting.
    Thank you for your time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •