JavaScript runtime error: 'kendo' is undefined

4 posts, 0 answers
  1. Shrikant
    Shrikant avatar
    38 posts
    Member since:
    Jul 2011

    Posted 31 Jul 2013 Link to this post

    Hi,

     I am trying to use Kendo UI with HTML 5 Chart, but its giving me error

     JavaScript runtime error: 'kendo' is undefined

    Can anyone tell me what I am missing?


    Thanks

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <script type="text/javascript">
        kendo.culture("<%= currCulture %>");
    </script>
    <!--Where currCulture is the variable storing the desired culture-->
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Height="400px" Width="400px">
        <PlotArea>
            <Series>
                <telerik:PieSeries>
                    <SeriesItems>
                        <telerik:PieSeriesItem Exploded="true" Y="53000" Name="Q1" />
                        <telerik:PieSeriesItem Exploded="false" Y="35000" Name="Q2" />
                        <telerik:PieSeriesItem Exploded="false" Y="47500" Name="Q3" />
                        <telerik:PieSeriesItem Exploded="false" Y="22300" Name="Q4" />
                    </SeriesItems>
                    <LabelsAppearance DataFormatString="C">
                    </LabelsAppearance>
                    <TooltipsAppearance DataFormatString="C"></TooltipsAppearance>
                </telerik:PieSeries>
            </Series>
            <YAxis>
            </YAxis>
        </PlotArea>
        <ChartTitle Text="Revenue">
        </ChartTitle>
    </telerik:RadHtmlChart>
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 05 Aug 2013 Link to this post

    Hi Shrikant,

    I have tried to reproduce the mentioned behavior but to no avail. Could you please watch the short video test, located in the attached archive and then tell me what I am missing?

    I can suggest you try the following:
    • Can you confirm that you are setting and adding the proper script reference of the localization file to the script manager?
    • Can you confirm that your version of RadControls is the latest one - 2013.2.717 and if not, does upgrading to it resolves the issue?

    If the above steps are not useful, could you please try to reproduce the issue with the attached archive and then tell me what changes you have made, so that I can proceed further with the investigation?


    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. Henrik
    Henrik avatar
    3 posts
    Member since:
    Sep 2012

    Posted 17 Aug 2013 Link to this post

    Hi Danail,

    I'm having the same issue here, maybe my description helps to localize the problem.

    On a reporting page with a RadHtmlChart and a RadGrid, this seems only to happen when the user first enters the page and no report data is loaded (the user is required to set some filters first and then press "load report"; the same dataTable is used for both the chart and the grid).
    When the report data is loaded, and the RadHtmlChart shows up, the error is gone.

    Best Regards,
    Henrik
  4. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1502 posts

    Posted 21 Aug 2013 Link to this post

    Hi Henrik,

    In order for the kendo.culture() method to take effect the RadHtmlChart must be loaded on the page. It seems that the RadHtmlChart hasn't been loaded yet on the page and that is why such an error is thrown.

    What I can suggest is that you call a JavaScript function that executes kendo.culture() and then repaints the chart, when the RadHtmlChart is loaded. For example:

    JavaScript:
    <script type="text/javascript">
        function LoclizeChart() {
            kendo.culture("fr-FR");
            $find("<%=RadHtmlChart1.ClientID%>").repaint();
        }
    </script>
    ASPX:
    <telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Height="400px" Width="400px">
        <PlotArea>
            <Series>
                <telerik:PieSeries>
                    <SeriesItems>
                        <telerik:PieSeriesItem Exploded="true" Y="53000" Name="Q1" />
                        <telerik:PieSeriesItem Exploded="false" Y="35000" Name="Q2" />
                        <telerik:PieSeriesItem Exploded="false" Y="47500" Name="Q3" />
                        <telerik:PieSeriesItem Exploded="false" Y="22300" Name="Q4" />
                    </SeriesItems>
                    <LabelsAppearance DataFormatString="C">
                    </LabelsAppearance>
                    <TooltipsAppearance DataFormatString="C"></TooltipsAppearance>
                </telerik:PieSeries>
            </Series>
            <YAxis>
            </YAxis>
        </PlotArea>
        <ChartTitle Text="Revenue">
        </ChartTitle>
    </telerik:RadHtmlChart>
    <telerik:RadButton ID="RadButton1" runat="server" Text="localize" OnClientClicked="LoclizeChart" AutoPostBack="false" />

    You can also find a short video in the attached archive that illustrates this.

    Regards,
    Danail Vasilev
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top