2011-06-01 84 views
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?

感謝,

回答

1

原來我有一種自行閉合span標記在HTML中又名

<span class="field-validation-valid" /> 

讓這裏成爲一個很好形成的標籤又名

所有的一切都完美。

嘆息,整整一天打起來