我有一个包含3列的表格:ID,名称,地址。我想从表中的选定行获取ID。无法正常工作...有人吗?
var data = new google.visualization.arrayToDataTable(dataRaw, false);
var table = new google.visualization.Table(document.getElementById('successTable'));
//Css
var cssClassNames = {
'headerRow': 'cssHeaderRow',
'tableRow': 'cssTableRow',
'oddTableRow': 'cssOddTableRow',
'selectedTableRow': 'cssSelectedTableRow',
'hoverTableRow': 'cssHoverTableRow',
'headerCell': 'cssHeaderCellSmall',
'tableCell': 'cssTableCellSmall',
'rowNumberCell': 'cssRowNumberCell'
};
var options = {
cssClassNames: cssClassNames,
allowHtml: true,
title: "Success",
};
table.draw(data, options);
google.visualization.events.addListener(table, 'select', selectHandler);
我尝试过:
function selectHandler() {
var sel = table.getSelection();}
还有其他东西,但是没有运气...