3

我有一个像下面这样的handsontable

var $container = $("#example1");
$container.handsontable({
data: data1,
rowHeaders:true,
colHeaders: ["Sun","Mon","Tue","Wed","Thr","Fri","Sat"],
cols:13,
minSpareRows: 100
});
<div id="example1" class="dataTable" style="width: 1170px; height: 450px; 
overflow:scroll;"></div>

我可以访问表 tr 值

 var rowList = $("#example1").handsontable("getData");
 rowList = $.grep(rowList,function(array,index)
 {
  // here i can access values from first row  


 });

我需要访问标题 "Sun","Mon","Tue","Wed","Thrs","Fri","Sat" 怎么做...?请帮助..

4

2 回答 2

3

只需使用:

hotInstance.getColHeader() 

来源:https ://docs.handsontable.com/pro/5.0.2/Core.html#getColHeader

于 2018-09-25T20:32:55.813 回答
2

我编辑了这个:

 var rowHeaderList = $("#example1").handsontable("getRowHeader"); //for row headers 
 var colHeaderList = $("#example1").handsontable("getColHeader"); //for column headers
于 2013-07-25T06:32:09.650 回答