Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get table header name in handsontable

i have a handsontable like below

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>

i can access table tr values

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


 });

I need to access headers "Sun","Mon","Tue","Wed","Thrs","Fri","Sat" How to do this...? ple help ..

like image 332
Boopathi Avatar asked Jan 18 '26 16:01

Boopathi


2 Answers

Just use:

hotInstance.getColHeader() 

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

like image 62
dasfdsa Avatar answered Jan 20 '26 06:01

dasfdsa


I edited this:

 var rowHeaderList = $("#example1").handsontable("getRowHeader"); //for row headers 
 var colHeaderList = $("#example1").handsontable("getColHeader"); //for column headers
like image 41
Nikola Kirincic Avatar answered Jan 20 '26 05:01

Nikola Kirincic



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!