var tree = $("#jstree").jstree({ "core": { "themes": { "responsive": false }, "check_callback": true, ‘data‘: { ‘url‘: function (node) { return ‘/test/jstreejson‘; }, ‘data‘: function (node) { return { ‘parent‘: 1000 }; } } }, "types": { "default": { "icon": "fa fa-folder icon-state-warning icon-lg" }, "file": { "icon": "fa fa-file icon-state-warning icon-lg" } }, //"state": { "key": "demo3" }, ‘plugins‘: [ "checkbox", "types"] }).on("changed.jstree", function (e, data) { //改变事件 }).bind("select_node.jstree", function (e, data) { //选中事件 }); //获取所有选中的值,并且获取待选的父级值 function ttt() { var idArray = new Array(); $("#jstree").find(".jstree-checked, .jstree-undetermined ").each(function () { idArray.push($(this).closest(‘li‘).attr("id")); }); idArray = idArray.concat($.jstree.reference($("#jstree")).get_selected()); alert(idArray.join(‘,‘)); } 做网站,做软件可以找天马网站建设http://www.tmddd.com/
时间: 2024-10-14 10:20:59