[CLOSED] MVC pass extra parameter to Store AjaxProxy Url.Action

  1. #1

    [CLOSED] MVC pass extra parameter to Store AjaxProxy Url.Action

    I am trying to pass in a hidden Id filed value to the Stores AjaxProxy method call.

    I have tried:

    .Url(Url.Action("GetCompanies", "CompData", new { id = "App.HidId.getValue()" }))
    This returns not found route when the extra param is there.

    I have tried:

    Html.X().AjaxProxy()
               .Url(Url.Action("GetCompanies"))
               .Reader(Html.X().JsonReader().Root("data"))
               .ExtraParams(x => x.Add(new Parameter() { Name = "id", Value = "App.hidid.getValue()", Mode = ParameterMode.Raw }))
    This does not even open the window where this is called from when I add the ExtraParams part. No exception, nothing... strange.

    My question is, what is the correct way for passing in an extra parameter when calling a method for the AjaxProxy?

    Thank you
    Last edited by fabricio.murta; Feb 21, 2015 at 4:28 PM. Reason: [CLOSED]
  2. #2
    Hello @registrator!

    Look at this example: Ajax Linked Combos

    See how they pass the country to retrieve the list of cities for that country. country is a string parameter to the getCities() method.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    Thank you @fabricio

    It works. So the parameter is added to the Store definition and not the AjaxProxy. This is where I went wrong in the start.
  4. #4
    Glad it worked! I suppose we may close this thread now, then?

    Let us know otherwise.
    Fabrício Murta
    Developer & Support Expert
  5. #5
    Yes, sure. Thank you.

Similar Threads

  1. Replies: 3
    Last Post: May 19, 2014, 12:56 PM
  2. Replies: 0
    Last Post: Oct 24, 2013, 2:53 PM
  3. [CLOSED] [Razor] AjaxProxy pass extra parameter
    By boris in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Sep 07, 2012, 8:15 AM
  4. Pass Parameter to store at runtime
    By Vaishali in forum 1.x Help
    Replies: 0
    Last Post: Feb 07, 2012, 6:58 AM
  5. [CLOSED] How to pass extra parameter on to TreeLoader
    By mxp in forum 1.x Legacy Premium Help
    Replies: 18
    Last Post: Mar 17, 2010, 2:40 PM

Posting Permissions