Results 1 to 8 of 8

Thread: How to send JSON data via 'ajax' proxy to a server by using store.load()?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Oct 2011
    Karlsruhe, Germany
    Vote Rating

    Question Answered: How to send JSON data via 'ajax' proxy to a server by using store.load()?


    how can I add some extra data to my request via a store proxy? The config 'extraParams:' in the proxy's config can only pass normal http parameters with a POST or GET request to the server. Is there a possibility to add custom data like JSON encoded strings to the server?

    Thanks in advance!

  2. I've found a solution!

    Jayrock is able to process GET requests. I stumbled about at where Atif Aziz links to a good documentation of Jayrock:

    Just a few things to change on the project files:
    1. Change on serverside the .NET [JsonRpcMethod("myJayrockNETMethod")] to [JsonRpcMethod("myJayrockNETMethod", Idempotent = true)] to enable GET requests and let jayrock handle the passing parameters.
    2. Change your store's proxy 'url:' to '/path/to/yourHandler.ashx/myJayrockNETMethod' to let Ext know, thtt there is the location to pass parameters to.
    3. Also change in the proxy config the 'extraParams:' (only if your 'myJayrockNETMethod' needs parameters), just assign in simple "key": "value" notation, like:
    extraParams: {
        "user": "peter",
        "site": "marketplace"
    Ext will encode the parameters to something like '/path/to/yourHandler.ashx/myJayrockNETMethod?user=peter&site=marketplace'

    If there are some special chars in the string, they will be encoded. Also a good place to experiment with url-encodings:

    Greetings, silent

Tags for this Thread

Posting Permissions

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