2013-07-25 65 views
1

表頭名我有一個像下面如何讓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 


}); 

我需要訪問頭「太陽報」,「星期一」一個handsontable, 「星期二」,「星期三」,「星期四」,「星期五」,「星期六」 如何做到這一點......? PLE幫助..

回答

1

我編輯此:

var rowHeaderList = $("#example1").handsontable("getRowHeader"); //for row headers 
var colHeaderList = $("#example1").handsontable("getColHeader"); //for column headers 
+0

其返回空數組,不包含任何值......反正感謝ü。 – Boopathi

+0

我的不好,你有列標題,而不是行,試試這個: 'var colHeaderList = $(「#example1」)。handsontable(「getColHeader」);' – niklaz

+0

謝謝你的工作。 – Boopathi