2012-11-22 19 views
6

jsTree(1.0-rc3)を使用してAJAXによるデータをロードするオプションがあり、〜2000個の子ノードのロードに関する問題があります。サーバーは数秒以内に応答しますが、ブラウザー(chrome、FF)で結果をレンダリングするのに約40秒かかるだけです。それに加えて、FFは 'jquery-1.7.2.min.js'からの応答がないことについての情報を返します。同じ量のデータがIEをフリーズします。それはデータで過負荷ですか?それとも何らかのバグですか?変更の要因はありますか?レンダリングの高速化に役立ちますか?jsTree - レンダリングの最適化| 2000ノードの非常に長いレンダリング

jQuery("#dependency-tree").jstree(
     { 
      'plugins':['themes', 'json_data', 'ui', 'core', 'types', 'sort'], 
      "json_data":{ 
       "progressive_render": true, 
       "data":initData, 
       cache:false, 
       "ajax":{ 
        "url":function (node) 
        { 
         return appContext + 'GetUnitsNode/' 
          + node.attr('id'); 
        }, 
        dataType:"text", 
        "success":function (data) 
        { 
         if (data == "none") 
         { 
          return false; 
         } 
         return jQuery.parseJSON(data); 
        } 
       } 
      }, 
      "ui":{ 
       'select_limit':1 
      }, 
      "core":{ 
       'animation':0, 
       'html_titles':true 
      }, 
      "themes":{ 
       "theme":"rules", 
       "dots":true, 
       "icons":true 
      }, 
      "types":{ 
       "types":{ 
        "default":{ 
         "icon":{ 
          "image":appContext + "/img/orange.png" 
         } 
        } 
       } 
      }, 
      "sort":function (a, b) 
      { 
       return this.get_text(a).toUpperCase() > this.get_text(b).toUpperCase() ? 1 : -1; 
      } 
     }).bind("select_node.jstree", function (event, data) 
     { 
      submitedNodeId = data.rslt.obj.attr('id'); 
      submitedNodeTypeId = data.rslt.obj.attr("typeId"); 
      submitedNodeLast = data.inst.is_leaf(data.rslt.obj); 
      g_node_text = jQuery(data.rslt.obj).children().eq(1).html(); 
     }); 
+0

につながる大規模なネストされたツリーを持っている場合に便利です2Kであなたの経験を想像してみてください... HTML5でこれをやっているのは実現可能なはずです。たぶん簡単なクラススイッチ(折りたたみ/展開)とDOM操作を最後の手段として – CapelliC

答えて

2

試しましたか?

  • progressive_render

    progressive_render Aブール。デフォルトはfalseです。 このオプションをtrueに設定すると、返されたJSONの可視(オープンノード)部分のみがDOMノードに変換され、隠された部分はすべて保存され、オンデマンドで解析されます(ノードが表示されたとき)。あなたが重いDOM

  • AJAXロード

  • jstreeの確実デモ低迷、でも3/4のノードと...私は「できれば
関連する問題