Hi,
The function you are looking for is DataView.getTableRowIndex(), which
traces the row back to the datatable (the visualization gets a view of the
datatable).
Here is a modified selection handler:
function selectHandler() {
var selection = table.getChart().getSelection();
if (selection.length > 0) {
var rowAtVisualization = selection[0].row;
var originalRow = table.getDataTable().*getTableRowIndex*
(rowAtVisualization);
alert("Row "+originalRow);
}
}
There is another issue that needs a bit of a workaround - the table
visualization maintains the selected rows even when the data is changed.
This does not really make sense on your scenario. To avoid this behavior you
can reset the selection after each redraw:
google.visualization.events.addListener(table, 'ready', function () {
table.getChart().setSelection([]);
});
HTH.
On Sat, Jun 25, 2011 at 8:43 PM, tracy love <[email protected]> wrote:
> the more i look at this the more i am thinking something is broken, as in a
> bug
> so from..
>
>
> http://code.google.com/apis/chart/interactive/docs/gallery/table.html#Methods
>
> "The row indexes in the selection object refer to the original data table
> regardless of any user interaction (sort, paging, etc.)."
>
> yeah but thats not what happens when you do a StringFilter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-visualization-api/-/KO6QsA80QY8J.
>
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.