handsontable學習(2) 資料繫結

2022-03-23 14:22:24 字數 560 閱讀 5004

一、資料繫結

handsontable類似vue,資料來源和handsontable是動態繫結的,一旦handsontable的資料發生改變,name資料來源的資料也發生了相應的改變。

所以,如果想讓handsontable的操作不改變源資料,可以使用資料副本

例:

var data2 = [

['', 'tesla', 'nissan', 'toyota', 'honda', 'mazda', 'ford'],

['2017', 10, 11, 12, 13, 15, 16],

['2018', 10, 11, 12, 13, 15, 16],

['2019', 10, 11, 12, 13, 15, 16],

['2020', 10, 11, 12, 13, 15, 16],

['2021', 10, 11, 12, 13, 15, 16]

],container2 = document.getelementbyid('example2');

hot2 = new handsontable(container2, );

Handsontable 學習筆記 Methods

閱讀目錄 handson 親自實踐 先給出資料來源和基本配置 var data a1 b1 c1 d1 a2 b2 c2 d2 a3 b3 c3 d3 var objectdata var container document.getelementbyid example var ht new ha...

Handsontable通用方法

1.clear 清空資料 2.createcol index,amount,createautomatically 新增列 index 列索引,amount 新增的列總數,createautomatically 為乙個數字 removecol index,amount 刪除列 createrow i...

handsontable 追加資料

之後決定選擇其他的框架來做 搜尋發現 handsontable 比較合適,追加資料時渲染速度很快,追加 500條資料用時在 200ms 之內。handsontable 的官網 handsontable 追加資料主要使用的方法是 getsourcedata 下面附上測試 testhandsontabl...