cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Problems with Kendo in custom visual with api version 2.x

I was able to get kendo grids and charts working inside a custom visual by following this approach

https://github.com/whileoneloop/kendo-ui-power-bi-visual

 

I then upgraded Kendo to 2019.r1.  This still works with version 1.7.0 of custom visuals api. 

 

However when upgrading using pbiviz update 2.3.0 (or 2.5.0) Kendo stops loading.  Has anyone gotten kendo working with kendo.all.min.js in these versions of API?

 

First issue found is solved by removing the hack (required in older version) from window.js which adds devicePixelRatio and innerWidth like so 

Object.defineProperties(window, {

   'devicePixelRatio': {
       get: function () {
           return window.window.devicePixelRatio;
       }
    },
    'innerWidth': {
        get: function () {
            return window.window.innerWidth;
        }
    }
});

 

However after removing that Kendo cannot initialize and fails with 
   VM1528:formatted:116772 Uncaught TypeError: Cannot read property 'util' of undefined
 
After some troubleshooting I could trace a line inside kendo that calls 
  this.kendo.util = this.kendo.util || {},
but this.kendo is undefined.
 
this = window with name "visual-sandbox"
 
here is screenhot of it at that break point in chrome debugger
debug-powerbi-kendo.jpg

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.