0
我想將JsArray與Webix組件DataTable一起使用。但我有一個問題。當我使用JsArray格式時,我無法更新Webix數據網格中的數據。不幸的是,我只能看到它的數據的開始。檢查樣品來理解這個問題:我想在Webix組件中使用JsArray DataTable
var array1 = [ [1,"Marie","Oslo"],[2,"John","Los Angeles"],[3,"Kate","London"] ];
var array2 = [ [4,"Martin","Manchester"],[5,"Joana","Lisbon"],[6,"Ronaldo","Barcelona"],[7,"Matthew","Portland"] ];
webix.ui({
view:"button",
label:"test new data",
click: function() {
new_data()
}
});
webix.ui({
view:"datatable",
id: "mytable",
columns:[
{id:"data0", header:"ID" },
{id:"data1", header:"Name" },
{id:"data2", header:"City" }
],
datatype: "jsarray",
data: array1
});
function new_data() {
var mytable = $$("mytable");
mytable.parse(array2);
}
按下按鈕「測試新數據」後,4個新的空行出現在表中。