1
JSTree在使用IE7和8时遇到了一些问题。它在IE9,FF4和Chrome上运行良好。JSTree JSON_DATA在IE7和IE8上
它通过由ASP.NET MVC3控制器操作支持的JSON_DATA插件加载数据。
问题是数据没有被加载到IE7-8上的树中。我可以验证这个动作是否被请求,并且没有错误被抛出,或者至少在错误函数中被捕获。
$("#changeGroupTree")
.bind("select_node.jstree", function(event, data) {
// `data.rslt.obj` is the jquery extended node that was clicked
var id = data.rslt.obj.attr("id");
$("input[name='changeGroup_GroupId']").val(id)
.siblings("span")
.addClass("field-validation-valid")
.removeClass("field-validation-error");
$.ajax({
type: "GET",
url: "/api/group/gettree",
data: { groupId: id },
dataType: "JSON",
success: function(data, status, jqXHR) {
$("#changeGroup_SelectedGroup").html(data[0]);
},
error: function(jqXHR, textStatus, errorThrown) {
var data = $.parseJSON(jqXHR.responseText);
$().toastmessage("showErrorToast", data.ErrorMessage);
}
}); // end ajax
}) // end bind
.bind("loaded.jstree", function(event, data) {
})
.jstree({
core: {
animation: 200
},
plugins: ["themes", "json_data", "ui"],
themes: {
theme: "default",
dots: "true",
icons: "true"
},
ui: {
select_limit: 1
},
json_data: {
ajax: {
url: "/api/group/getgroups",
data: function(node) {
return { customerId: CUSTOMER_ID, parentId: (node.attr) ? node.attr("id") : "00000000-0000-0000-0000-000000000000" };
},
error: function(jqXHR, textStatus, errorThrown) {
alert("JSTree Error when getting Group data");
}
}
}
}); // end jstree
这里是从服务器返回的JSON
[{ “ATTR”:{ “ID”: “d9cc2cb9-fbc4-4726-a9b1-9eee00f1e2b8”}, “数据”:” MTM“,”状态“:”关闭“,”图标“:”组“}]
我错过了一些东西,以获取数据绑定在旧的IE?
感谢,