如何将jstree节点保存到数据库中?

时间:2018-08-01 07:20:23

标签: javascript jquery jstree

$('#jstree').jstree({
  core: {
    check_callback: true,
    data: [{
        "id": "1",
        "parent": "#",
        "text": "PKM"
      },
      {
        "id": "2",
        "parent": "1",
        "text": "Deve"
      },
      {
        "id": "3",
        "parent": "1",
        "text": "Test"
      },
      {
        "id": "4",
        "parent": "1",
        "text": "Prod"
      }
    ],
  },
  plugins: ["wholerow", "unique", "dnd", "sort", "state", "contextmenu", "contextmenubtn", "themes"]
}).on("ready.jstree", function(e, data) {
  data.instance.open_all();
});
var temp1, temp2, obj;
$('#jstree').on("changed.jstree", function(e, data) {
  var i, j, r = [],
    q = [];
  for (i = 0, j = data.selected.length; i < j; i++) {
    r.push(data.instance.get_node(data.selected[i]).id);
    q.push(data.instance.get_node(data.selected[i]).text);
    temp1 = 3;
    temp2 = q;
  }
  $("#section").html("<textarea></textarea>");

}).jstree();

0 个答案:

没有答案