Handsontable通用方法

2022-04-19 05:48:19 字數 865 閱讀 6062

1.clear():清空資料

2.createcol(index,amount,createautomatically):新增列

index:列索引,amount:新增的列總數,createautomatically:為乙個數字

removecol(index,amount):刪除列

createrow(index):新增行

removerow(index,amount):刪除行

3.get(row,prop):根據行號和屬性索引獲取單元格的值

getall():獲取所有的資料

getcopyable(row,prop):根據行號和屬性索引獲取單個單元格的值

getcopyabletext(start,end):獲取被選擇位置的值

satrt:開始選擇的位置物件,end:結束選擇的位置物件

getrange(start,end,destination):根據座標獲取資料

satrt:開始選擇的位置物件,end:結束選擇的位置物件,destionation:目的地map索引

gettext(start,end):獲取目標位置的資料

4.set(row,prop,value,source):設定單個單元格的值

row:行索引,prop:列索引,value:新值,source:hook外掛程式的提供者

5.splicecol(col,index,amount):新增或移除列資料

col:列索引,index:開始改變的陣列索引,amount:改變資料的個數

splicerow(row,index,amount):新增或刪除行資料

row:行索引,index:開始改變的陣列索引,amount:改變資料的個數

handsontable 追加資料

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

Handsontable之隱藏列

之所以記錄官網api,是因為本屌絲沒有vpn,官網訪問速度慢。不喜勿噴。原官網api 外掛程式允許隱藏某些列。通過呈現寬度設定為0px的列來實現隱藏。該外掛程式不修改源資料和不參與資料轉換 返回資料的形狀 由getdata 方法保持不變 可能的外掛程式設定 例const container docu...

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...