2017-09-26 80 views
1

嘿傢伙即時通訊面臨一個問題,在webix中我想顯示爲rowwise,但即時通訊無法找到如何以這種方式顯示我可以在列明智地顯示它從數據庫中採取數據已轉換爲json格式。這裏是一小段代碼片段,請給我一些建議webix datatable列明智的行明智

<script type="text/javascript"> 
 
     webix.ajax("datacon.php", function(text, incomingData){ 
 
      //text = '{ some :"abc"}' 
 
      var data=incomingData.json(); 
 

 

 

 
      webix.ui({ 
 
       container: "box", 
 
       rows:[ 
 
        {view:"template", type:"header", template: "some text"}, 
 
        {view: "datatable", data: data, height: 300, 
 
         columns:[ 
 
          {id:"date", header:"Date"}, 
 
          {id:"ob", header:"OB"}, 
 
          {id:"ore", header:"ORE"}, 
 
          {id:"stratio", header:"Stripping Ratio"} 
 
         ] 
 
        } 
 

 
       ] 
 
      });

回答

0

其實你的代碼不能正常工作。它顯示片段中的錯誤,請檢查。另外,在上面的代碼中,你必須提到一個視圖類型,比如「view:datatable/list/tree」或者其中任何一個。進行更改並恢復。

在webix DataTable中,您不能添加單個行。您必須根據其打印模式寫入數據。

這裏的數據表中的一個簡單的例子,從webix

<script src="https://cdn.webix.com/edge/webix.js"></script> 
 
<link rel="stylesheet" type="text/css" href="https://cdn.webix.com/edge/webix.css"> 
 

 
<script> 
 
var datatable = webix.ui({ 
 
    view:"datatable", 
 
    columns:[ 
 
     { id:"rank", header:"",    width:50}, 
 
     { id:"title", header:"Film title", width:200}, 
 
     { id:"year", header:"Released",  width:80}, 
 
     { id:"votes", header:"Votes",   width:100} 
 
    ], 
 
    data: [ 
 
     { id:1, title:"The Shawshank Redemption", year:1994, votes:678790, rank:1}, 
 
     { id:2, title:"The Godfather", year:1972, votes:511495, rank:2} 
 
    ] 
 
}); 
 
</script>

你只需要與各自的數據標籤符合您的「身份證」。列中引用的Id應該與數據文件的「Keys」相同。此外,該列的標題使用「標題」參數進行設置。

這些是一些有助於使用webix進行更快速開發的工具。

  1. https://webix.com/skin-builder/?utm_source=newsletter&utm_medium=email&utm_campaign=3_free_tools_to_create_awesome_apps&utm_term=2017-09-26

  2. https://webix.com/form-builder/?utm_source=newsletter&utm_medium=email&utm_campaign=3_free_tools_to_create_awesome_apps&utm_term=2017-09-25

+0

我已經張貼在這裏我需要我剛纔提到的視圖類型,如果ü可以看到那邊的解決方案的一部分,和u剛纔複製粘貼文件。我需要改變外觀列明智的行明智display.i執行項目我不能發佈所有那些我只想改變那部分 – manmaurya