3
我從xml文件輸入樹數據。拖放操作後,我需要在點擊按鈕後保存xml數據。 data.inst.get_xml(「nest」,-1,li_attr,a_attr)事件給出了當前的xml。我如何保存這在MVC 3視圖的XML文件Jstree使用jstree插件將樹保存到xml文件
這是用來呈現樹形
$(document).ready(function() {
li_attr = ["id", "class"];
a_attr = ["href"];
$("#Sampletree").jstree({
"xml_data": {
"ajax": {
"url": "../../Content/Files/Sample.xml"
},
"xsl": "nest"
},
"plugins": ["themes", "xml_data", "dnd", "ui"
},
{
"dnd": {
"drop_finish": function() {
alert("DROP");
},
"drag_check": function (data) {
if (data.r.attr("id") == "phtml_1") {
return false;
}
return {
after: false,
before: false,
inside: true
};
},
"drag_finish": function (data) {
alert("DRAG OK");
}
}
})
.bind("select_node.jstree", function (e, data) {
alert(data.inst.get_xml("nest", -1, li_attr, a_attr)
});
});