This is a migrated thread and some comments may be shown as answers.

JavaScript runtime error: 'kendo' is undefined

3 Answers 374 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shrikant
Top achievements
Rank 1
Shrikant asked on 31 Jul 2013, 05:12 PM
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>

3 Answers, 1 is accepted

Sort by
0
Danail Vasilev
Telerik team
answered on 05 Aug 2013, 03:58 PM
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.
0
Henrik
Top achievements
Rank 1
answered on 17 Aug 2013, 08:06 PM
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
0
Danail Vasilev
Telerik team
answered on 21 Aug 2013, 06:37 PM
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.
Tags
General Discussions
Asked by
Shrikant
Top achievements
Rank 1
Answers by
Danail Vasilev
Telerik team
Henrik
Top achievements
Rank 1
Share this question
or