[CLOSED] Set actionMethods of AJAXProxy

  1. #1

    [CLOSED] Set actionMethods of AJAXProxy

    Hi,

    I have the code below to load data of the chart from a remote data source. It is developed in asp.net mvc3 + razor view engine.
    It is working fine, but the only problem is that the data is loaded through GET not POST. I am sure that the ajaxproxy has a actionmethods property, but I am not sure how to set the value of the property. Any help is appreciated.


        @Html.X().Panel().Title("Area Chart").Width(800).Height(600).Layout("FitLayout").TopBar(topBar => topBar.Add(Html.X().Toolbar().Items(items =>
            {
                items.Add(Html.X().Button().Text("Reload Data").Icon(Icon.ArrowRefresh).Listeners(listener =>
                    { listener.Click.Handler = "#{Store1}.reload();"; }));
                items.Add(Html.X().Button().Text("Animate").Icon(Icon.ShapesManySelect).EnableToggle(true).Pressed(true).Listeners(listeners =>
                    {
                        listeners.Toggle.Handler = "#{Chart1}.animate = pressed ? {easing: 'ease', duration: 500} : false;";
                    }));
            }))).Items(items =>
                {
                    items.Add(Html.X().Chart().ID("Chart1").StyleSpec("background: #fff").Legend(true).Animate(true).Store(store => store.Add(Html.X().Store().ID("Store1").Model(model => model.Add(Html.X().Model().Fields(fields =>
                        {
                            fields.Add(Html.X().ModelField().Name("Name"));
                            fields.Add(Html.X().ModelField().Name("Data1"));
                            fields.Add(Html.X().ModelField().Name("Data2"));
                            fields.Add(Html.X().ModelField().Name("Data3"));
                            fields.Add(Html.X().ModelField().Name("Data4"));
                            fields.Add(Html.X().ModelField().Name("Data5"));
                            fields.Add(Html.X().ModelField().Name("Data6"));
                            fields.Add(Html.X().ModelField().Name("Data7"));
                        }))).Proxy(proxy => proxy.Add(Html.X().AjaxProxy().Url(Url.Action("GetData","Home")).Reader(reader => reader.Add(
                            Html.X().JsonReader().Root("data")
                        )))))).Axes(axes =>
                            {
                                axes.Add(Html.X().NumericAxis().Fields(new string[] {"Data1", "Data2", "Data3", "Data4", "Data5", "Data6", "Data7"}).Title("Number of Hits").Minimum(0).GridConfig(new AxisGrid() { Odd = new SpriteAttributes() {Opacity = 1, Fill = "#ddd", Stroke = "#fff", StrokeWidth = 1}}));
                                axes.Add(Html.X().CategoryAxis().Position(Position.Bottom).Fields(new string[]{"Name"}).Title("Month of the Year").Grid(true).Label(new AxisLabel() { Rotate = new RotateAttribute() {Degrees = 315}}));
                            }).Series(series => series.Add(Html.X().AreaSeries().Axis(Position.Right).XField(new string[] {"Name"}).YField(new string[] {"Data1", "Data2", "Data3", "Data4", "Data5", "Data6", "Data7"}).Style(new SpriteAttributes() {Opacity = 0.93}))));
                })
    Last edited by Daniil; Apr 25, 2012 at 9:54 PM. Reason: [CLOSED]
  2. #2
    Hi,

    This way:

    Example
    .Proxy(proxy => proxy.Add(Html.X().AjaxProxy()
                .ActionMethods(methods =>
                    methods.Read = HttpMethod.GET 
                )
            )
    )
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    This way:

    Example
    .Proxy(proxy => proxy.Add(Html.X().AjaxProxy()
                .ActionMethods(methods =>
                    methods.Read = HttpMethod.GET 
                )
            )
    )
    Got an exception: CS1061: 'Ext.Net.AjaxProxy.Builder' does not contain a definition for 'ActionMethods' and no extension method 'ActionMethods' accepting a first argument of type 'Ext.Net.AjaxProxy.Builder' could be found (are you missing a using directive or an assembly reference?)
  4. #4
    It has been already fixed in SVN, please update.

    The Ext.NET v2 SVN:
    http://svn.ext.net/premium/branches/2.0
  5. #5
    Quote Originally Posted by Daniil View Post
    It has been already fixed in SVN, please update.

    The Ext.NET v2 SVN:
    http://svn.ext.net/premium/branches/2.0
    Thanks a lot. Just wondering, when will this update available through NuGet (The last updated date of the current package is Mar 8th, 2012).
  6. #6
    The Beta 2 release should appear very soon.

Similar Threads

  1. [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
  2. Replies: 6
    Last Post: Jun 25, 2012, 3:50 PM
  3. Replies: 2
    Last Post: Jun 03, 2012, 4:18 PM
  4. Replies: 0
    Last Post: Jun 03, 2012, 3:46 AM

Tags for this Thread

Posting Permissions