Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
whileoneloop
New Member

Exception raised when using Telerik Kendo UI components in PowerBI's visualsandbox

 

Attempting to use an external UI library (Telerik Kendo UI) and receiving the following exception:

 

--

Uncaught TypeError: Illegal invocation
at <anonymous>:562:21817
at <anonymous>:562:27218
at <anonymous>:563:18554
at <anonymous>:563:18651
at t.kendo.t.kendo.cultures (<anonymous>:562:21)
at Window.<anonymous> (<anonymous>:562:59)
at <anonymous>:841:20
at Object.r [as injectJsCode] (visualhostcore.min.js:2)
at i.loadWithoutResourcePackage (visualsandbox.min.js:1)
at i.executeMessage (visualsandbox.min.js:1)

--

 

A compatible version of jquery is loaded and initialised before the Telerik component js.  A repoduction is available here:

 

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

 

An issue has been posted in the PowerBI-visuals git repo:

 

https://github.com/Microsoft/PowerBI-visuals/issues/239

 

Have also sent a support ticket to Telerik.

 

Has anyone been able to load Kendoui in the PowerBI sandbox?

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

You have to include these code into your code:

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

var kendo = { cultures: {} };
window.kendo = kendo;
window.window.kendo = kendo;

Please take a look at this pull request.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

View solution in original post

2 REPLIES 2
v-viig
Community Champion
Community Champion

You have to include these code into your code:

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

var kendo = { cultures: {} };
window.kendo = kendo;
window.window.kendo = kendo;

Please take a look at this pull request.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

pbicvsupport@microsoft.com

This no longer works when upgrading api from 1.7.0 to 2.3.0 or 2.5.0.

it seems the 2 properies are no longer need but later and issue is faced where code this.kendo.util  throws TypeError: Cannot read property 'util' of undefined.  In running their samples this refers to window object so not clear why this is failing due to pbiviz api update.  

 

Anyone know how to resolve this ?

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.