YUI DataTable - how to avoid "Terminate this script?" confirm message

I am using YUI DataTable in my web application. While my DataTable is retrieving data, if I close it and navigate to another DataTable, I keep getting the message "Do you want to terminate this Script?" confirm the message. I want to avoid this message and I want to stop the script from running right after the DataTable is closed. Please give your suggestions. Please let me know if you need more information. I am making a webservice call from JavaScript to populate a DataTable. I suspect that is causing the prompt. I will need a way to stop the script from making a webservice call

Displaying DataTable:   ShowDialog (DisambigPanel, ReturnElement) document.getElementById ("DisambigList") focus () ;.

DisambigDataSource = new YAHOO.util.DataSource(DisData[CurDisType].URL);
DisambigDataSource.responseType = YAHOO.util.DataSource.TYPE_XML;  
DisambigDataSource.responseSchema = {resultNode: DisData[CurDisType].Node, fields: DisData[CurDisType].Fields};         

var TableConfig =
{
    sortedBy: {key:DisData[CurDisType].SortKey, dir:"asc"},
    selectionMode: "single",
    initialRequest: BuildRequestString(),
    scrollable: true,        
    width: "940px",
    height: "340px",
    renderLoopSize: 20
}; 

YAHOO.widget.DataTable.MSG_LOADING = "<img src=\"/Images/Wait/DataGrid.gif\" alt=\"Loading animation\"/> Loading...";
YAHOO.widget.DataTable.MSG_EMPTY = "No results.";
DisambigTable = new YAHOO.widget.DataTable("DisambigList", DisData[CurDisType].ColumnHeaders, DisambigDataSource, TableConfig);

YAHOO.util.Event.removeListener("DisambigList", "keydown"); 
YAHOO.util.Event.addListener("DisambigList","keydown",DisambigKeyDown);

DisambigTable.subscribe("initEvent",DisambigLoad);
DisambigTable.subscribe("cellDblclickEvent",DisambigSelect);
DisambigTable.subscribe("rowSelectEvent",DisambigSelectionChange) 

      

ShowDialog function (dialog, returnFocus) {OldFocus = returnFocus; VisibleDialog =

dialog.show()

var x = new YAHOO.util.KeyListener(document, { keys:27 }, { fn: HideDialog, scope:dialog, correctScope:true } ); 
x.enable();
dialog.cfg.queueProperty("keylisteners", x);

      

}

function HideDialog () {
  // Hide the current dialog if it is visible if (VisibleDialog) {// Hide the current dialog VisibleDialog.hide (); VisibleDialog = null; }

if (OldFocus)
{
    OldFocus.focus();
    OldFocus = null;
}

      

}

+2


source to share


1 answer


Well, as far as I remember, this kind of prompt is shown by FireFox if the script takes too long or is in an infinite loop. Try to check if it works in another browser other than the one you are using ...



+1


source







All Articles