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

OnClientResize only fires on load

4 Answers 42 Views
Window
This is a migrated thread and some comments may be shown as answers.
mabs
Top achievements
Rank 1
mabs asked on 29 Sep 2010, 11:44 AM
I am creating a new instance of a popup and then adding the OnClientResize,
var popup = window.radopen(Url, null);
popup.OnClientResize = OnClientResize();
When the popup opens/loads the function is fired, however it is never fired again when resizing.

However, if i add it to the radwindowmanager, and assign the same function to it, it will work every time.
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" KeepInScreenBounds="true"
                          ReloadOnShow="false" VisibleStatusbar="false" ShowContentDuringLoad="false"
                          EnableShadow="true" OnClientResize="OnClientResize">
</telerik:RadWindowManager>
I do not wish to add it it to the radwindowmanager as the function i need to call is not available on that page.

Any help with this would be much appreciated.

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Sep 2010, 12:17 PM
Hello Russell,

The correct way to add a resize handler is to use the client-side API of the control (add_resize()). For example:
var oWnd = radopen('myUrl', 'myWindow');
oWnd.add_resize(OnClientResize);

function OnClientResize()
{
  //your code here
}



All the best,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
mabs
Top achievements
Rank 1
answered on 29 Sep 2010, 12:34 PM
Thank you for the reply.

I can add this fine, and it will work the first time.  I think it would work all of the time, however when I attempt to resize the window i get a javascript error,

a[b] is not a function

All I am doing is,
var win = GetRadWindow();
win.add_resize(OnClientResize());
 
function OnClientResize() {
}
This is being called when the content of the radwindow loads.
0
Georgi Tunev
Telerik team
answered on 29 Sep 2010, 02:13 PM
Hello Russell,

At this point I cannot tell what is the reason for the problem, but if you open a support ticket and send me a sample project, I will check it right away.

Thank you in advance for your cooperation.

Greetings,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Georgi Tunev
Telerik team
answered on 30 Sep 2010, 09:29 AM
Hi,

Just a quick followup because in the project that Russel sent (thank you again) I saw that I missed the problem in the last piece of code. RadWindow/RadWindowManager's functions like add_resize / remove_resize / add_show etc. accept the name of the function only.
i.e.
win.add_resize(OnClientResize()); is wrong

win.add_resize(OnClientResize);
is correct.



Greetings,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
mabs
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
mabs
Top achievements
Rank 1
Share this question
or