Sochettra / dynatree

Automatically exported from code.google.com/p/dynatree
0 stars 0 forks source link

Add error information to onPostinit() #224

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Bug report from `ken`
  https://groups.google.com/d/topic/dynatree/lb3FDSXhZ4Q/discussion
-------------
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. 

Original issue reported on code.google.com by moo...@wwwendt.de on 4 Sep 2011 at 2:53

GoogleCodeExporter commented 8 years ago
Fixed #1: using logWarning instead of logError

Original comment by moo...@wwwendt.de on 4 Sep 2011 at 2:57

GoogleCodeExporter commented 8 years ago
Fixed with r525, r526

Original comment by moo...@wwwendt.de on 4 Sep 2011 at 3:09

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 4 Sep 2011 at 3:13

GoogleCodeExporter commented 8 years ago
considered verified

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:16

GoogleCodeExporter commented 8 years ago

Original comment by moo...@wwwendt.de on 17 Jul 2012 at 4:19