OnClientResize only fires on load

5 posts, 0 answers
  1. mabs
    mabs avatar
    57 posts
    Member since:
    May 2010

    Posted 29 Sep 2010 Link to this post

    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.
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Sep 2010 Link to this post

    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
  3. mabs
    mabs avatar
    57 posts
    Member since:
    May 2010

    Posted 29 Sep 2010 Link to this post

    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.
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 29 Sep 2010 Link to this post

    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
  5. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 30 Sep 2010 Link to this post

    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
Back to Top