I am using the following client-side code to delete a node from a tree:
It successfully delete the node client-side but throws this exception in the console:
[Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: onHTTPSpyReadyStateChange :: line 497" data: no]
Also, the node does not get deleted server-side. Running the project in debug mode, I never see where or how the exception get raised. Is there any solution to this problem?
* I am using Q1 2009 SP1 controls
function tvNavigation_ClientNodeDropping(sender, args) { |
var elem = args.get_htmlElement(); |
if(elem==null || elem.id != "TrashCan") { |
args.set_cancel(true); |
return; |
} |
var tree = $find('<%= tvNavigation.ClientID %>'); |
tree.trackChanges(); |
try { |
var sourceNode = args.get_sourceNode(); |
var parent = sourceNode.get_parent(); |
parent.get_nodes().remove(sourceNode); |
} |
catch(ex) { console.log(ex); } |
tree.commitChanges(); |
} |
It successfully delete the node client-side but throws this exception in the console:
[Exception... "'Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "JS frame :: chrome://firebug/content/spy.js :: onHTTPSpyReadyStateChange :: line 497" data: no]
Also, the node does not get deleted server-side. Running the project in debug mode, I never see where or how the exception get raised. Is there any solution to this problem?
* I am using Q1 2009 SP1 controls