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

Closing Radwindow causes endless javascript error

1 Answer 52 Views
Window
This is a migrated thread and some comments may be shown as answers.
m chotu
Top achievements
Rank 1
m chotu asked on 13 Jan 2011, 08:23 PM

Hi Telerik support team;

We have a web page which is opening a modal radwindow.  This radwindow loads another aspx page.  In the modal popup, a search is done and the search results are shown in a radgrid.  When a row is clicked on the radgrid, then the window closes and passes values back to the calling page and populates a text box.

The problem is that on the popup, if the search returns about 5000+ rows, and if one of the rows is clicked, then window closes but causes a javascript endless loop which in IE produces a dialog that says "Stop running this script? A script on this page is causing your web browser to run slowly.  If it continues to run, your computer might become unresponsive."  Could you please suggest a fix for this?  I have attached the javascript code on the calling page and the lookup page loaded in the radwindow.  Thanks in advance,

Meera

Calling Page:

Js code:

 

function openRadWindow(windowname) {

 

 

 

var accPage = '<%=Page.ResolveUrl("LookUpProducts.aspx") %>';

 

 

 

var txthiddenproduct = document.getElementById("<%= hiddenProductName.ClientID %>");

 

txthiddenproduct.value =

 

"";

 

 

 

var oWnd = radopen(accPage, "Product Lookup");

 

oWnd.add_close(clientClose);

oWnd.setSize(920, 600);

oWnd.set_modal(

 

true);

 

oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Resize + Telerik.Web.UI.WindowBehaviors.Maximize)

 

 

var y = document.documentElement.scrollTop;

 

 

 

var x = document.documentElement.scrollLeft;

 

oWnd.moveTo(x + 50, y + 50);

}

 

 

 

 

 

 

function

 

 

clientClose(sender, eventArgs) {

 

 

 

var arg = sender.argument;

 

sender.SetUrl(

 

"about:blank");

 

 

 

var products = document.getElementById("<%= acProductNames.ClientID %>");

 

 

 

var txthiddenproduct = document.getElementById("<%= hiddenProductName.ClientID %>");

 

 

 

if (arg) {

 

 

 

if (txthiddenproduct.value == "") {

 

products.value = arg;

txthiddenproduct.value = arg;

}

}

}

 

 

Popup page within radwindow:
Javascript code:

 

 

 

function RowSelected(sender, args) {

 

 

 

 

var productname = args.getDataKeyValue("ProductName");

 

 

 

if (productname === null || productname === "") {

 

productname =

 

"NoValue";

 

}

 

 

var returnvalue = args.getDataKeyValue("ProductName");

 

 

returnArg(returnvalue);

}

 

 

var oWnd;

 

 

 

function pageLoad() {

 

oWnd = GetRadWindow();

}

 

 

function returnArg(value) {

 

oWnd = GetRadWindow();

oWnd.argument = value;

 

// Set the updated value in button click

 

 

 

 

 

oWnd.close();

}

 

 

function GetRadWindow() {

 

 

 

var oWindow = null;

 

 

 

if (window.radWindow)

 

oWindow = window.radWindow;

 

 

else if (window.frameElement.radWindow)

 

oWindow = window.frameElement.radWindow;

 

 

return oWindow;

 

}

 

 


1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 18 Jan 2011, 05:00 PM
Hello m chotu,

 The provided code is not enough ti understand the problem. Having so many records is not easy to cope with and I am not completely sure what exactly you are doing in your search.

What I can suggest is to set debug="false" in the Web.config in case you have not - when it is set to true, this causes additional operations which also influence the performance.

In case this does not help, please prepare a sample, fully runnable reproduction demo (you can use a fake programmatic datasource if you do not want to share a database), upload it for download on the net and share the download link here. Please, do not include the Telerik.Web.UI dll there but simply mention it and we will see what could be done.

Best wishes,

Svetlina
the Telerik team

 

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Window
Asked by
m chotu
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or