title: how to get the metadata of jsTree.
body: <p>This is my code:</p>
  
  <pre><code>$("#demo1").jstree({
          "themes": {
              "theme": "default",
              "dots": true,
              "icons": true,
              "url": "static/themes/default/style.css"
          },
          "ui" : {
                  // this makes the node with ID node_4 selected onload
                  "initially_select" : [ location.hash.slice(1).split('@')[1]]
              },
          "json_data" : {
              "data" : [
                  { 
                      "data" : "A node", 
                      "attr" : { "id" : "1" ,time:1321},
                      "callback":function(){alert('sss')},
                      "children" : [ 
                          {
                              "data" : "ttt node", 
                              "children" : [ "Child 1", "Child 2" ]   
                          }
                       ]
                  },
                  { 
                      "attr" : { "id" : "2" }, 
                      "data" : { 
                          "title" : "Long format demo", 
                          "attr" : { "href" : "#" } 
                      } 
                  },
                  {
                      "data" : "sss node", 
                      "attr" : { "id" : "3" },
                      "children" : [ 
                          {
                              "data" : "bbb node"
                          }
                          ,
                          {
                              "data" : "kkkk node", 
                              "attr" : { "id" : "11" },
                              "children" : [ 
                                  {
                                      "data" : "oooo node", 
                                      "children" : [ "pppp", "nnnn" ] 
                                  }
                               ]
                          },
                      ]
                  },
                  {
                      "data" : "wwqq node",
                      "attr" : { "id" : "4" },
                      "children" : [ "Child 1", "Child 2" ]   
                  },
                  {
                      "data" : "hhh node",
                      "attr" : { "id" : "5" },
                      "metadata ":"i am the metadata",
                      "children" : [ 
                              {
                              "data" : "A node", 
                              "children" : [ 
                                  {
                                      "data" : "ttt node", 
                                      "children" : [ "Child 1", "Child 2" ]   
                                  }
                                  ]
                              },
                              {
                              "data" : "bbb node"
                              }
  
                          ]   
                  },
              ]
          },
          /*
          "sort":function (a, b) { 
              return this.get_text(a) &lt; this.get_text(b) ? 1 : -1; 
              },
          ////*/
          "contextmenu":{
                  "show_at_node":false,
                  "items":{
                          //"ccp":false,
                          "sort" : {
                              // The item label
                              "label"             : "sort",
                              /* The function to execute upon a click
                              "action"            : function (obj) { 
                                                      var fn=function (a, b) {return this.get_text(a) &lt; this.get_text(b) ? 1 : -1;}
                                                      this.changeSort(obj,fn);
  
                                                      },
                              //*/
                              // All below are optional 
                              "_disabled"         : false,        // clicking the item won't do a thing
                              "_class"            : "sort",   // class is applied to the item LI node
                              "separator_before"  : false,    // Insert a separator before the item
                              "separator_after"   : true,     // Insert a separator after the item
                              // false or string - if does not contain `/` - used as classname
                              "icon"              : false,
                              "submenu"           : { 
                                  "name":{
                                          "label" : "name",
                                          "action": function (obj) { 
                                                          var fn=function (a, b) {return this.get_text(a) &lt; this.get_text(b) ? 1 : -1;}
                                                          this.changeSort(obj,fn);
                                                      }
                                      },
                                  "time":{
                                          "label" : "time",
                                          "action": function (obj) { 
                                                          var fn=function (a, b) {return this.get_text(a) &lt; this.get_text(b) ? 1 : -1;}
                                                          this.changeSort(obj,fn);
  
                                                      }
                                      }
                                  }
                          },
                          "icons":{
                              "label"             : "icons",
                              "action":function(obj){window.a=obj;},
                              "submenu"           : { 
                                  "apple":{
                                          "label" : "apple",
                                          "action": function (obj) { 
                                                          this.set_theme('apple');
                                                      }
                                      },
                                  "classic":{
                                          "label" : "classic",
                                          "action": function (obj) { 
                                                          this.set_theme('classic');
                                                      }
                                      },
                                  "default":{
                                          "label" : "default",
                                          "action": function (obj) { 
                                                          this.set_theme('default');
                                                      }
                                      }
                                  }
  
                          }
              }
          },
          "core" : { "initially_open" : [ ] },
          "plugins" : [ "themes", "json_data","crrm","ui","contextmenu","search","sort" ]
      })
      .bind("search.jstree", function (e, data) {
              alert("Found " + data.rslt.nodes.length + " nodes matching '" + data.rslt.str + "'.");
          });
  </code></pre>
  
  <p>i set the metadata:</p>
  
  <pre><code>"metadata ":"i am the metadata",
  </code></pre>
  
  <p>and want to get it when i right click,on the "contextmenu" :</p>
  
  <pre><code>"icons":{
                              "label"             : "icons",
                              "action":function(obj){console.log(this.data);},
  </code></pre>
  
  <p>I show this.data follow this <a href="http://www.jstree.com/documentation/json_data" rel="nofollow noreferrer">article</a>:</p>
  
  <pre><code>// the `metadata` property will be saved using the jQuery `data` function on the `li` node
      metadata : "a string, array, object, etc",
  </code></pre>
  
  <p>but I can't get it, what can I do?</p>