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

Updated to 2014.3.1119: Several JS errors in Grid

1 Answer 283 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Indicia
Top achievements
Rank 1
Indicia asked on 11 Dec 2014, 08:13 AM
Hi there. Yesterday, I have updated my MVC project to Telerik UI for ASP.NET MVC 2014.3.1119. I was updating from version 2014.2.1008. However, several javascript errors appear, and some basic functionality is not working.

I will provide two examples of malfunctioning I ran into.

1. Pagesizes:
@(Html.Kendo().Grid(Model)
      .Name("ServiceGrid")
      .Pageable(action => action.Enabled(true)
                .ButtonCount(8)
                /*.PageSizes(new[] {25, 100, 500}) TODO this yields an error in the current Telerik */
                .Refresh(true))
      .DataSource(data => data
              .Ajax()
          .Events(events => events.Error("grid_onError"))
          .Model(model =>
          {
              model.Id(m => m.Name);
          })
          .Read(read => read.Action("Get", "Service"))
          .Group(g => g.Add(f => f.Host))
      )
      .Columns(column =>
      {
          column.Bound(ci => ci.FriendlyName).Title("Service");
          column.Bound(ci => ci.Host).Hidden();
          column.Bound(ci => ci.Status);
          column.Command(cmd => cmd.Custom("Restart Service").Click("onClickRestartService")).Width(120).Title("Actions");
      }))

The commented out line shows what was functioning correctly in version 2014.2.1008, but isn't anymore in 2014.3.1119. This JS error appears when I uncomment the code:
Uncaught TypeError: undefined is not a function
kendo.web.min.js:11 ht.extend.pageSize
jquery-2.1.1.js:7328 (anonymous function)
jquery-2.1.1.js:375 jQuery.extend.each
jquery-2.1.1.js:139 jQuery.fn.jQuery.each
jquery-2.1.1.js:7320 jQuery.fn.extend.val
kendo.web.min.js:20 u.extend.init
kendo.web.min.js:29 ut.ui.DataBoundWidget.extend._pageable
kendo.web.min.js:28 ut.ui.DataBoundWidget.extend.initkendo.web.min.js:10 (anonymous function)

When I click on the error, Chrome leads me to this place in the kendo.web.min.js code:
pageSize:function(e){var n=this;return e!==t?(n._query({pageSize:e,page:1}),t):n.take()},sort
(with the cursor positioned at 'n._query')

2. Export to Excel
I wanted to add the new 'Export to Excel' functionality to most of my grids. I have added the required method to my Controller, and have added the two relevant code snippets to the Razor grid code (the toolbar part and the the Excel-part with the ProxyURL, fileName and filterable).

The button appears correctly, however, when I click it, this JS error appears in the console:
Uncaught TypeError: undefined is not a function
kendo.dataviz.min.js:12 ht.extend.success
kendo.dataviz.min.js:12 n.trigger.n.online.n.transport.read.success
kendo.dataviz.min.js:11 n.success
jquery-2.1.1.js:3073 fire
jquery-2.1.1.js:3185 self.fireWith
jquery-2.1.1.js:8251 done
jquery-2.1.1.js:8598 (anonymous function)

When I click the error, the console leads me to this JS part in kendo.dataviz.min.js:
a._pristineData=e.slice(0),a._detachObservableParents()
(more specifically, at 'slice').

My gut feeling tells both these errors have the same cause.
I have made sure the version is updated completely by using kendo.version(), and by checking the served file headers in the Chrome developer tools.
I would be very glad if someone could point me in the right direction..

1 Answer, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 13 Dec 2014, 03:38 PM
Hello,

From the description of the errors it seems that you have included both the kendo.web.min.js and kendo.dataviz.min.js files which as described in this documentation will cause problems. Please check if the errors are still thrown after using kendo.all instead of the kendo.web and kendo.dataviz files.

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Indicia
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or