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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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