[英]JSTree JSON_DATA on IE7 and IE8
在讓 JSTree 與 IE7 和 8 一起工作時遇到一些問題。它在 IE9、FF4 和 Chrome 上運行良好。
它通過由 ASP.NET MVC3 controller 操作支持的 JSON_DATA 插件加載數據。
問題是數據沒有加載到 IE7-8 上的樹中。 我可以驗證正在請求操作,並且沒有拋出錯誤或至少在錯誤 function 中被捕獲。
$("#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"},"data":"MTM","state":"close","icon":"Group"}]
我是否遺漏了一些東西來獲取舊 IE 中的數據綁定?
謝謝,
原來我在 html aka 中有一個自閉合跨度標簽
<span class="field-validation-valid" />
把它做成一個格式良好的標簽,又名
一切都很完美。
嘆息,一整天都在為此奮斗
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.