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

Customization of RadWindow through ClientSide javascript

10 Answers 378 Views
Window
This is a migrated thread and some comments may be shown as answers.
Imran
Top achievements
Rank 1
Imran asked on 22 Jan 2009, 01:55 PM
I want to remove refresh,pin,maximize and minimize buttons from WindowTitle. I am not using Window Manager.I am using ClientSide javascript to invoke that window.here is my javascript that creates window.

function showEmailtoFriendWindow(ImageButton) {
        var oWnd = radopen("EmailToFriend.aspx", "EmailToFriendWin");
        oWnd.SetWidth(220);
        oWnd.SetHeight(200);
        var pos = GetTopLeftPosition(ImageButton);
        oWnd.moveTo(pos.x + parseInt(ImageButton.clientWidth), pos.y);
        oWnd.show();
    }
function GetTopLeftPosition(element) {
        var left = 0;
        var top = 0;

        while (element.offsetParent) {
            left += element.offsetLeft;
            top += element.offsetTop;
            element = element.offsetParent;
        }
        if (element.x) left = element.x;
        if (element.y) top = element.y;
        var oPos = new Object();
        oPos.x = left;
        oPos.y = top;
        return oPos;
    }
from here I want to remove those button through code.Kindly help me in this regard.

Thanks

10 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 22 Jan 2009, 02:53 PM
Hi Imran,

You can set the Behaviors property of the RadWindow object from client side. Set the behaviour to None for not showing any behaviour.

JavaScript:
function showEmailtoFriendWindow(ImageButton)  
{  
     var oWnd = radopen("EmailToFriend.aspx""EmailToFriendWin");  
     oWnd.SetWidth(220);  
     oWnd.SetHeight(200);  
     var pos = GetTopLeftPosition(ImageButton);  
     oWnd.moveTo(pos.x + parseInt(ImageButton.clientWidth), pos.y);  
     oWnd.set_initialBehaviors(Telerik.Web.UI.WindowBehaviors.None); // set the desired behaviours  
     oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None); //set the desired behaviours  
     oWnd.show();  
}   

Thanks,
Princy.
0
Imran
Top achievements
Rank 1
answered on 23 Jan 2009, 04:34 AM
Hello Princy,

Thanks a lot, it really solved my problem.Actually I was confused because I read some posts on this forum which says that this kind of thing is not possible from Client side script and it will be available in future versions.Once again thank you.

Regards

Imran Zahid
Software Engineer
Softech Worldwide
0
Imran
Top achievements
Rank 1
answered on 26 Jan 2009, 05:51 AM
Hello ,
I have a Custom Skin which I created from modifying an existing skin , Since I am loading the windows from client side java script, I need a method to set my custom skin from java script too.I have searched the methods of Client side Rad window but there is no such method as set_Skin..is there any method to set my custom skin through javascript?

Thanks

0
Fiko
Telerik team
answered on 27 Jan 2009, 11:59 AM
Hello Imran,

This is not possible - because the skins are taken from the server, currently there is no way you can set them by using RadWindow's client-side API to set the skin via JavaScript.
In scenario like yours, we suggest to declare several RadWindows with different skins on the page and to open the corresponding window when needed.


Greetings,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Richard Maxwell
Top achievements
Rank 1
answered on 16 Mar 2009, 06:25 PM
This throws an error for me.  My DLL is in the GAC, is this a problem for the client side?
0
Georgi Tunev
Telerik team
answered on 17 Mar 2009, 12:08 PM
Hello Richard,

Could you please provide some more information about your problem? What exactly are you trying to achieve and what is the error?

Sincerely yours,
Georgi Tunev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Richard Maxwell
Top achievements
Rank 1
answered on 17 Mar 2009, 04:13 PM
    oWnd.set_initialBehaviors(Telerik.Web.UI.WindowBehaviors.None); // set the desired behaviours  
     oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None); //set the desired behaviours  
    
These lines of code throw a javascript error for me, can't find the dll
0
Georgi Tunev
Telerik team
answered on 18 Mar 2009, 09:01 AM
Hello Richard,

Make sure that you are using a recent version of RadControls for ASP.NET AJAX. If the problem still exists, please open a support ticket and send us a sample project where this issue could be reproduced.


Regards,
Georgi Tunev
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
KMILO
Top achievements
Rank 2
answered on 21 Apr 2009, 04:45 PM
Hi Guys,

Could you tell me how you correct that error, actually it is appearing to me too when I try to set behaviors through javascript, more exactly using this instructions:

 

   function SetSizeTowindow(width,height)  
    {  
        var oWnd = GetRadWindow();  
        debugger;  
        //oWnd.set_initialBehaviors(Telerik.Web.UI.WindowBehaviors.None); // set the desired behaviours     
        //oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.None);   
        oWnd.SetSize(width,height);          
        oWnd.Center();  
    }   

Thank you in advance

KMILO

 

 

 

 

0
Georgi Tunev
Telerik team
answered on 22 Apr 2009, 08:20 AM
Hello Camilo,

The reason for your problem is different - I noticed that you are trying to set the behaviors from the content page. You get an error because the code for the behaviors enum is taken from the RadWindowManager - it exists in your parent page, but you don't have it in the content page, hence the error.

The good news is that there is an easy solution for that. Please check the following forum post for more details: set_Behaviors (client side).




Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Window
Asked by
Imran
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Imran
Top achievements
Rank 1
Fiko
Telerik team
Richard Maxwell
Top achievements
Rank 1
Georgi Tunev
Telerik team
KMILO
Top achievements
Rank 2
Share this question
or