2017-08-21 12 views
0

のアイテムを持つJavaScriptオブジェクトがあり、階層を定義する配列はです。このデータを持つkendoTreeViewウィジェットを作成すると、loadOnDemandがfalseに設定されていると、不確定であったはずのチェックボックスはチェックされていません。剣道UIツリービュー - ローカルデータにバインドされたときのチェックボックス状態の更新

私がこれを修正したのは、loadOnDemandをtrueに設定し、すべてのノードを展開して折りたたむことでした。

私はユーザーの操作でツリーのリーフノードを操作しているので、展開と折り畳みが必要です。

loadOnDemandをfalseに設定する方法はありますか?

答えて

0
<!DOCTYPE html> 
<html> 
    <head> 
    <base href="http://demos.telerik.com/kendo-ui/treeview/local-data-binding"> 
    <style>html { font-size: 14px; font-family: Arial, Helvetica, sans-serif; }</style> 
    <title></title> 
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1028/styles/kendo.common-material.min.css" /> 
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1028/styles/kendo.material.min.css" /> 
    <link rel="stylesheet" href="//kendo.cdn.telerik.com/2016.3.1028/styles/kendo.material.mobile.min.css" /> 

    <script src="//kendo.cdn.telerik.com/2016.3.1028/js/jquery.min.js"></script> 
    <script src="//kendo.cdn.telerik.com/2016.3.1028/js/kendo.all.min.js"></script> 
    </head> 
    <body> 
    <div id="example"> 

     <div class="demo-section k-content"> 
     <h4>Inline data (default settings)</h4> 
     <div id="treeview-left"></div> 
     </div> 


     <script> 
     var inlineDefault = new kendo.data.HierarchicalDataSource({      
      data: [{ 

      "Name": "Test", 
      "enabled": true, 
      "text": "Test", 
      "id": "Test", 
      "Description": null, 
      "Key": null, 
      "items": [{ 
       "Name": "Workspace", 
       "enabled": true, 
       "text": "Workspace", 
       "id": "Workspace", 
       "Description": null, 
       "Key": null, 
       "items": [], 
       "checked": true, 
       "expanded": true 
      }, 
         { 
         "Name": "Deploy", 
         "enabled": true, 
         "text": "Deploy", 
         "id": "Deploy", 
         "Description": null, 
         "Key": null, 
         "items": [{ 
          "Name": "Test.Deploy.Application", 
          "enabled": true, 
          "text": "Application", 
          "id": "Test.Deploy.Application", 
          "Description": "", 
          "Key": "Test.Deploy.Application", 
          "items": [], 
          "checked": false, 
          "expanded": true 
         }, 
            { 
            "Name": "Test.Deploy.Visualization", 
            "enabled": true, 
            "text": "Visualization", 
            "id": "Test.Deploy.Visualization", 
            "Description": "", 
            "Key": "Test.Deploy.Visualization", 
            "items": [], 
            "checked": true, 
            "expanded": true 
            }, 
            { 
            "Name": "Test.Deploy.Application Workspace", 
            "enabled": true, 
            "text": "Application Workspace", 
            "id": "Test.Deploy.Application Workspace", 
            "Description": "", 
            "Key": "Test.Deploy.Application Workspace", 
            "items": [], 
            "checked": false, 
            "expanded": true 
            }], 
         "checked": null, 
         "expanded": true 
         }], 
      "checked": null, 
      "expanded": true 
      }] 

     }); 

     $("#treeview-left").kendoTreeView({ 
      dataSource: inlineDefault, 
      checkboxes: { 
      checkChildren: true, 
      }, 
      loanOnDemant:false, 
     }); 


     </script> 
    </div> 


    </body> 
</html> 

私の仕事です! For more details

関連する問題