5

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?

ARUNRAJ
  • 469
  • 6
  • 15

1 Answers1

3

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
Community
  • 1
  • 1
Ahmad Ibrahim
  • 1,915
  • 2
  • 15
  • 32