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

reposition radwindow and open multiple windows

1 Answer 22 Views
Window
This is a migrated thread and some comments may be shown as answers.
yao wang
Top achievements
Rank 1
yao wang asked on 07 May 2010, 04:09 PM
Hi,

I am stuck on a project for a while. please give me some suggestion.

The requirement is that there is a radlistbox which contains buttons in a radwindow AAA. Once I click any button inside the radlistbox, a new radwindow BXX will show up in a designed position according to which button has been clicked.If the button has not been clicked before,a new radwindow BXX will be opened. That means if I clicked two different buttons, two new radwindow BXX will be opened in the window. If the button has been clicked, there is no need to open new radwindow.

Also, the radwinow AAA which contains the radlistbox could be repositioned in the window. If it is repositioned, when I click any button inside the radlistbox, a position of new radwindow BXX according to the reposition.

My question 1 is. how to open multiple new radwindows BXX in desgined position? I use the code below and only get a radwindow BXX instead of multiple radwindow BXX.
 

 

 

function ShowWindow(assetId){

 

 

 

var pos = GetTopLeftWidthPosition(assetId);

 

 

 

var oMan = GetWindowManager();

 

 

 

var oWnd = oMan.getWindowById("WIDGETcf0376226a6944999bc3269b48fbc4ac");

 

oWnd.setUrl(

 

"<%=GetWidgetURL(Settings.PAGE_ASSETMARKETVIEW)%>" + "?aid=" + assetId, "WID_AMV_ONE"+assetId.toString());

 

oWnd.moveTo(pos.left,pos.top);

oWnd.show();

oWnd.setActive();

 

}

My question 2 is. When I reposition the radwindow AAA using the code below, it only work after second reposition.

 

 

 

var oMan= GetWindowManager();

 

 

 

var oWnd=oMan.getWindowByName("WIDGET74ce09f36ebe4fffa45389e9303526f2");

 

oWnd.setUrl("<%=GetWidgetURL(Settings.PAGE_ASSETSELECTOR)%>","WID_AMV_ONE");

 

 

 

oWnd.add_dragEnd(OnClientDragEnd);

oWnd.show();

 

 

 

var oMan= GetWindowManager();

 

 

 

var oWnd=oMan.getWindowByName("WIDGET74ce09f36ebe4fffa45389e9303526f2");

 

 

 

 

oWnd.setUrl("<%=GetWidgetURL(Settings.PAGE_ASSETSELECTOR)%>","WID_AMV_ONE");

 

 

 



 

 

 

function OnClientDragEnd(sender, eventArgs)

 

{

window.setTimeout(

 

function () {

 

bounds = sender.getWindowBounds();

}, 20);

}

1 Answer, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 May 2010, 01:37 PM
Hello yao wang,

With your code, you get a reference to a particular RadWindow, set its Url and show it. When this code is called for a second time, the same RadWindow will be used - if you want to get a new RadWindow you should create it first (for example with radopen()).

As for your second question, I have already answered it in this forum post.


Best wishes,
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
yao wang
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Share this question
or