mmalinowski42 / dynatree

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

Unable to get property options of undefinied or null reference (regression of r693). #478

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Configure a dynatree using external data. (I'm also using lazy loading - if 
this matters somehow.
2. Reload the page.

var options = $.extend({}, this.tree.options.ajaxDefaults, ajaxOptions, {
    success: function(data, textStatus, jqXHR){
        // <this> is the request options
                        //self.tree.logDebug("appendAjax().success");
        var prevPhase = self.tree.phase,
            options = this.tree.options; // #473  <====== HERE

        self.tree.phase = "init";
        // postProcess is similar to the standard dataFilter hook,
        // but it is also called for JSONP
        if( options.postProcess ){
            data = options.postProcess.call(this, data, this.dataType);
        }

After revision r693 I'm having the following error:

-Unable to get property options of undefinied or null reference.

My code:

   <script type="text/javascript">
  $(function(){
    $("#tree").dynatree({
          title: "Lazy loading sample",
          fx: { height: "toggle", duration: 200 },
          autoFocus: false, // Set focus to first child, when expanding or lazy-loading.
          title : "DynaTree",
          initAjax: {
             data: {},
             url: '/eye/tree_menu/json/{{proj_name}}'
            // url: '/static/sample-data1.json'
              },
      onActivate: function(node) {
        $("#echoActive").text("" + node + " (" + node.getKeyPath()+ ")");
      },

      onLazyRead: function(node){

              node.appendAjax({
               // url: '/static/sample-data2.json',
               url: '/eye/tree_menu/json/{{proj_name}}',
                data: {key: node.data.key},
                addActiveKey: true
              });

      }
    });

  });

    </script>

<body class="example">

<div style="height:500px" id="tree"></div>

</body>

Thank you for your work!

Original issue reported on code.google.com by michalry...@gmail.com on 14 Mar 2014 at 8:56

GoogleCodeExporter commented 9 years ago
Does this fix it?
https://code.google.com/p/dynatree/source/detail?r=699

Original comment by moo...@wwwendt.de on 14 Mar 2014 at 4:51

GoogleCodeExporter commented 9 years ago
Yes, it does.

Thank You.

Original comment by michalry...@gmail.com on 17 Mar 2014 at 6:19

GoogleCodeExporter commented 9 years ago

Original comment by moo...@wwwendt.de on 17 Mar 2014 at 6:51