MVC: Unable to add a chart to tabpanel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    MVC: Unable to add a chart to a tabpanel

    Hi,

    I evaluate 4.0.0 RC. When I add a partialview with a chart to a tabpanel I get an error.
    Everything is correct when I use Html.RenderPartial for the partialview.

    What am I doing wrong or is it a bug?

    thanks,
    Martin


    The error message is:

    [TokenNotUniqueException: Token is not unique
    -------------------
    ID = \
    TagName = anchor
    Match = <#:anchor id="id9a948acade8bbf9f_ClientInit" />
    ]
    Transformer.NET.Token.ParseAnchors() +355
    Transformer.NET.TextTransformer.Parse(List`1 tokensType, Dictionary`2 variables) +669
    Transformer.NET.TextTransformer.Transform(List`1 tokensType, Dictionary`2 variables) +31
    Transformer.NET.TextTransformer.Transform(List`1 tokensType) +25
    Transformer.NET.TextTransformer.Transform() +40
    Ext.Net.ExtNetTransformer.Transform(String text) +150
    Ext.Net.InitScriptFilter.Transform() +72
    Ext.Net.InitScriptFilter.Flush() +76
    System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +9641741
    System.Web.HttpResponse.FilterOutput() +104
    System.Web.CallFilterExecutionStep.System.Web.Http Application.IExecutionStep.Execute() +58
    System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean& completedSynchronously) +69
    Controller Snippet:

            public ActionResult BasicChart()
            {
                return PartialView(model.ChartModel);
            }
    
            public ActionResult Chart()
            {
                return View(model.ChartModel);
            }
    Partial View with Chart:

    @model List<Ext.Net.MVC.Examples.BasicChartModel>
    
    @Html.X().ResourceManager()
    
    @{
        ViewBag.Title = "Line Chart - Ext.NET MVC Examples";
        var X = Html.X();
    }
    
    @(X.CartesianChart()
        .Animation(false)
        .FlipXY(false)
        .Height(500)
        .Store(X.Store()
            .Data(Model)
            .Model(X.Model()
                .Fields(
                    X.ModelField().Name("Name"),
                    X.ModelField().Name("Data1")
                )
            )
        )
        .Axes(
            X.NumericAxis()
                .Fields("Data1")
                .Position(Position.Left)
                .Grid(true)
                .Maximum(100)
                .Renderer(r => r.Handler = "return label.toFixed(0) + '%';"),
    
            X.CategoryAxis()
                .Position(Position.Bottom)
                .Fields("Name")
                .Grid(true)
        )
        .Series(
        X.LineSeries()
            .XField("Name")
            .YField("Data1")
            .Smooth(3)
            .HighlightConfig(X.Sprite().Radius(7))
            .Marker(X.CircleSprite().Radius(4).LineWidth(0))
        )
    )
    View with Tab:

    @model List<Ext.Net.MVC.Examples.BasicChartModel>
    
    @{
        ViewBag.Title = "Chart";
        Layout = "~/Views/Shared/_Layout.cshtml";
        var X = Html.X();
    }
    
    
    @(X.TabPanel().ActiveTabIndex(0)
                      .Width(1000)
                      .Height(350)
                      .Items(X.Panel().Title("Chart 1")
                                      .AutoScroll(true)
                                      .Html(Html.Partial("BasicChart", Model).ToHtmlString()),
    
                            X.Panel().Title("Chart 2")
                                      .AutoScroll(true)
                                      .Html("Hello World")
                  )                
    )

    Working View:

    @model List<Ext.Net.MVC.Examples.BasicChartModel>
    
    @{
        ViewBag.Title = "Chart";
        Layout = "~/Views/Shared/_Layout.cshtml";
    }
    
    @{Html.RenderPartial("BasicChart", Model);}
    When I use
    .Loader(X.ComponentLoader().Url(Url.Action("BasicChart", Model))
    instead of
    .Html(Html.Partial("BasicChart", Model).ToHtmlString())
    there is no error, but the tab is empty.
    Last edited by marjot2112; Mar 24, 2016 at 4:26 PM.

Similar Threads

  1. Replies: 0
    Last Post: Dec 02, 2015, 5:00 AM
  2. [CLOSED] Unable to get Chart Mouse events working
    By Woodhac in forum 3.x Premium Help
    Replies: 6
    Last Post: Apr 29, 2015, 6:10 AM
  3. Replies: 2
    Last Post: Nov 08, 2013, 2:14 PM
  4. Unable to get the PopUp Dynamic Chart
    By nagesh in forum 2.x Help
    Replies: 6
    Last Post: Dec 05, 2012, 5:42 AM
  5. Replies: 2
    Last Post: Mar 29, 2010, 10:04 AM

Tags for this Thread

Posting Permissions