I am having a bit of an issue, If I add event functions for select and sort
on my table the default Google functions run anyway. It's kind of hard to
explain, but here is a very simple example...
var chart = new google.visualization.Table(document.getElementById('myTable'
));
google.visualization.events.addListener(chart, 'sort', function(e) {
handleSort(e, chart); });
chart.draw(opts, dataTable);
function handleSort(e, chart) {
if(e.column == 9) {
console.log('inside sort function');
return false;
}
}
With that code above, when I click on the header for column 9 I get the
console log of 'inside sort function', but then the table sorts itself on
that column. I have even tried doing this...
function handleSort(e, chart) {
if(e.column == 9) {
chart.options['sortColumn'] = 0;
chart.options['isAscending'] = true;
}
}
When that runs, it still sorts the table by column 9. No matter what I do I
can't get the table to stop sorting. I did set 'sort' to 'event' in the
opts object that gets passed in to the draw method.
Please, I am pretty desperate for ideas or answers. I need to make the
table stop sorting when column 9 is clicked on. The reason... there is a
button in the header for column 9, when the user clicks that button it is
supposed to do an action, which is does, but it sorts the table which ruins
everything. Thank you in advance for any help, I appreciate all input.
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-visualization-api/f6d1fcdd-a669-4f2f-8ca4-fbae08999480%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.