how to test for failure in initAjax?

465 views
Skip to first unread message

Ken

unread,
Sep 2, 2011, 1:10:19 PM9/2/11
to Discuss jquery.dynatree.js
I would like to test for the failure of the Ajax call in initAjax. I
first tried this:

$("#tree").dynatree({
initAjax: {url: "/getAllNamespaces.app",
success: function(node) {
console.log("initAjax.success... ");
},
error: function(node, XMLHttpRequest, textStatus,
errorThrown) {
console.log("initAjax.error... ");
},
},
...etc

This results in the message:

Uncaught TypeError: Object Dynatree 'tree' has no method 'logError'
jquery.dynatree.js:2227

When I look at that line of dynatree code I see:

if( ajaxOpts.success ){
this.logError("initAjax: success callback is ignored; use
onPostInit instead.");
}

And similar code for error.

So I understand that I should use onPostInit instead of success and
error.

Question 1: Where is logError defined?
Question 2: How do I get useful information within my implementation
of onPostInit about the failure?

I'm interested in the information available to the normal error method
such as textStatus and errorThrown.


mar10

unread,
Sep 4, 2011, 10:55:43 AM9/4/11
to dyna...@googlegroups.com
1: logError does not exist. You found a bug here.
2: currently this info is lost

I created an issue for this
  http://code.google.com/p/dynatree/issues/detail?id=224
Hope to fix it with 1.2 final.

Reply all
Reply to author
Forward
0 new messages