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.
Thx in advance,
Glenn
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