I am working in a web application using kendo grid.I've an iframe which contains kendo grid and need to access the kendo options from outside using jquery.
Yeah I tried to access the element using below code
Iframe.contentWindow.find....this code returns the element but when I try to extend this to kendo element (element.data("kendoGrid") ) it shows undefined.Any help?
You tried to find the element using the iframe.contentWindow
(which is right), but you didn't use the jQuery object of the iframe 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's your grid object
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With