使用多视图进行树和数据表映射

tree and datatable mapiing with multiview

我是 webix 的新手,正在尝试解决文件管理器组件问题,所以我有一个代表文件结构的树,例如 tree structure

Tree function here

  var docTree ={
  view:"tree",
 // editable:true,
  editor:"text",
   select:true,
   css:"doc_tree",
   id:"docTree",
   width:300,
   height:500,
   data:pdf_data,
   drag:true,
   type:"lineTree",
   };

  data-table  function here

  var dataTable ={

  view: "datatable",
  id:"dataTable",
   columns: [
   { id: "Name", header: "...", width: 2}, // 1st col displays item 'IDs'
   { id: "Date" }, // 2nd col displays item 'titles'
   { id: "Type" },  // 3rd col displays item 'values'
   { id: "size" } 
     ]

     };

所以我希望文件夹文件显示在数据中-table 像浏览器一样每次点击树,我相信这与多视图有关。

您可以将选择处理程序附加到树小部件,并从中调用数据加载命令以用数据填充网格

docTree.attachEvent("onAfterSelect", function(id){
  dataTable.clearAll();
  dataTable.load("/files/"+id);
})