How to access kendo grid settings inside iframe from outside?

I am working in a web application using kendo grid. The core of the iframe contains the kendo grid and you need to access the kendo parameters externally using jquery.

Yes, I tried to access the item using below code

Iframe.contentWindow.find .... this code returns this element, but when I try to propagate it to kendo element (element.data ("kendoGrid")) it shows undefined. Any help?

+3


source to share


1 answer


You tried to find the element using iframe.contentWindow

(that's correct), but you didn't use the jQuery iframe object instead of the main window jQuery object.

You can access it this way :



var framejQuery = $('#frameID')[0].contentWindow.$;
var element = $('#frameID').contents().find('#gridID')[0];
var grid = framejQuery.data(element, 'kendoGrid');         // Here your grid object

      

+1


source







All Articles