title: jstree prevent moving node into child nodes
body: <p>So I've been using jstree for a while now, but still can't get a handle on it, it's pretty much a headache but well, it was decided we were gonna work with it. The data I'm using comes from HTML (no JSON involved). The issue I'm having is that I'm not sure how to set that some nodes are not folders. Every node has a class and based on that class I'm able to change it's icon but if the user tries to send any node inside these nodes that are not supposed to be folders they will be able. I need to prevent this, one way or the other but every thing I've test so far has not work at all.</p>
  
  <pre><code>$("jstree").jstree({
              "core": {
                  "animation": 0,
                  "check_callback": true
              },
              rules: { draggable: "all" },
              "dnd": {
                  "drop_finish": function (data) {
                      if (data.o.attr("rel") === "ds") {
                          //update chart with new data here?
                          //using data.o.attr("id")
                      }
                  },
                  "drag_check": function (data) {
                      if (data.r.attr("rel") != "ds") {
                          return false;
                      }
                      return {
                          after: false,
                          before: false,
                          inside: true
                      };
                  }
              },
              "crrm": {
                  "move": {
                      "check_move": function (data) {
                          // alert(data.r.attr("id"));
                          if (data.r.attr("id") == "999") {
                              return false;
                          }
                          else {
                              return true;
                          }
                      }
                  }
              },
  
              "plugins": ["dnd", "crrm"]
          });
  </code></pre>
  
  <p>That's what I'm using to create my tree. Also, I cannot disable drag and drop since some items should be moved if the user wants but obviously the user shouldn't be able to drag something into anything that is not a folder.</p>
  
  <p>Thanks in advance for the help,</p>
  
  <p>Regards,</p>
  
  <p>Adrian.</p>