This is a migrated thread and some comments may be shown as answers.

Subscribe to rowSelected event from iframe parent window

2 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 18 Nov 2011, 10:17 AM
Hello,
I have an AJAX control which contains an IFRAME which load a page and grid on it. Like this:
parent page -> AJAX control -> IFRAME -> grid
I'd like to subscribe grid's rowSelected event from my control. That's what I do:
1. Searching for grid:
this._grid = this._frame.contentWindow.$find(this._frame.contentWindow.gridID);
if (this._grid != null) {
            this._grid.add_rowSelected(this._onRowSelected);
        }
_onRowSelected: function (sender, args) {
    },
this._grid object in my control is a valid grid object so it must start my handler when event fires. But it never starts. I tried to subscribe rowSelected event within page in iframe and it works fine. What's wrong? Is that because grid and my control are on "different" pages? I quote this because they're all defined within a single DOM and they should "know" about each other.
Please help.

2 Answers, 1 is accepted

Sort by
0
Dmitry
Top achievements
Rank 1
answered on 18 Nov 2011, 03:21 PM
I found something. When I call add_rowSelected, I get a stack overflow error.
0
Tsvetina
Telerik team
answered on 23 Nov 2011, 11:07 AM
Hello Dmitry,

Try setting debug="false" in the web.config file and see if the code works afterwards:
<compilation debug="false">
.....

The MS AJAX library throws a "Stack overflow..." error in a similar scenario when debug="true" is set. You could also try the same thing with another script control (not a RadGrid) to confirm that this is the same general MS AJAX issue. 

A forum thread elaborating on a common scenario in RadWindow where this issue is observed is available here:
http://www.telerik.com/community/forums/aspnet-ajax/window/add-event-to-the-radwindow-on-the-client-cause-a-javascript-error-out-of-stack-space.aspx
 
Regards,
Tsvetina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Dmitry
Top achievements
Rank 1
Tsvetina
Telerik team
Share this question
or