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

OnGridDestroying ScriptLoader is already loading scripts

4 Answers 97 Views
Grid
This is a migrated thread and some comments may be shown as answers.
glenn
Top achievements
Rank 1
glenn asked on 23 Jul 2008, 08:47 AM
Hi,

I attached an event on OnGridDestroying that checks if the grid has been changed and asks the user to save the changes.
But i always get the error: Microsoft JScript runtime error: Sys.InvalidOperationException: ScriptLoader.loadScripts cannot be called while the ScriptLoader is already loading scripts.

I don't get this error when i attach this handler to another event like onclick.
Somebody who knows the reason?

This error only happens in IE. firefox doesn't give this error.

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"
<script type="text/javascript"
    var hasChanges, inputs; 
 
    function GridCreatedEventHandler(sender, eventArgs) 
    { 
        var gridElement = sender.get_element(); 
        var elementsToUse = []; 
        inputs = gridElement.getElementsByTagName("input"); 
        for (var i = 0; i < inputs.length;i++) 
        { 
            if(inputs[i].type.toLowerCase() == "hidden") 
            { 
                continue; 
            }         
            Array.add(elementsToUse, inputs[i]); 
            inputs[i].onchange = OnChangeEventHandler
        } 
        setTimeout(function(){if(elementsToUse[0])elementsToUse[0].focus();},100); 
    } 
     
    function GridDestroyingEventHandler(sender, eventArgs) 
    { 
        if(hasChanges) 
        { 
            if(confirm("Update changes?")) 
            { 
                hasChanges = false
                var masterTable = $find("<%= grdvGrid.ClientID %>").get_masterTableView(); 
                masterTable.updateEditedItems(); 
            } 
            else 
            { 
                hasChanges = false
            } 
        } 
    } 
 
    function OnChangeEventHandler(e) 
    { 
        hasChanges = true
    } 
</script> 
</telerik:RadCodeBlock> 
         
       
<CSystems:GridView ID="grdvGrid" runat="server"
    <ClientSettings> 
        <ClientEvents OnGridCreated="GridCreatedEventHandler" OnGridDestroying="GridDestroyingEventHandler"/> 
    </ClientSettings> 
</CSystems:GridView> 


Thx in advance,
Glenn

4 Answers, 1 is accepted

Sort by
0
glenn
Top achievements
Rank 1
answered on 24 Jul 2008, 07:13 AM
When i use the asp scriptmanager i have no problem.

some help please?
0
glenn
Top achievements
Rank 1
answered on 25 Jul 2008, 08:02 AM
someone????
0
Sebastian
Telerik team
answered on 25 Jul 2008, 08:09 AM
Hi Glenn,

Have you encountered that you experience the issue with the script loading when using RadScriptManager instead of asp ScriptManager control? If this is the case, we will appreciate if you isolate a stripped working version of your project (attached to a formal support ticket) which operates properly with the MS ScriptManager and fails with RadScriptManager. We will debug it locally and advice you further.

Also verify that you are using the latest release 2008.2.723 of RadControls for ASP.NET AJAX (announced a couple of days ago).

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Levi
Top achievements
Rank 1
answered on 18 Oct 2008, 07:46 PM
I've had similiar problems... The minute I removed the RadAjaxManager it solved the problem. I had to combine the standard Microsoft controls (updatepanel, etc.) with the telerik controls that im using. The problem seems to be related to working with dynamically loaded user controls.
Tags
Grid
Asked by
glenn
Top achievements
Rank 1
Answers by
glenn
Top achievements
Rank 1
Sebastian
Telerik team
Levi
Top achievements
Rank 1
Share this question
or