I’m developing a JavaScript application using Google Visualization API. I wrote a event listener so whenever the user clicks in the column, he has the option to hide it, if he does not want to see it.
google.visualization.events.addListener(table, 'select',
function selectHandler(){
var data_table = table.getDataTable();
confirm("hide column?", "Yes", "No");
alert(data_table.removeColumn(0));
}
);
I get the following error:
data_table.removeColumn is not a function
alert(data_table.removeColumn(0));
The API description can be seen here. It’s interesting why the first alert tells me “30”, the number of columns in the table, while the removeColumn(index) function does not do anything at all. Any Thoughts?
Thanks
I suspect that perhaps
data_tableis not, in fact, not the type of object you expect.Have you used
console.dirto look at the methods available on it?