You should create the ready event handler after creating the table and
before drawing the table:
table = new google.visualization.Table(document.getElementById('table1'));
google.visualization.events.addListener(table, 'ready', resizeTable);
table.draw(dataTable, {width: 1100});
Defining the resizeTable function outside the drawVisualization function
could cause issues with variable scope (if you need to access anything that
is internal to drawVisualization), but otherwise it should work.
On Sunday, February 16, 2014 6:26:25 AM UTC-5, Shannon Whitty wrote:
>
> I have tried to implement the ready event handler, basically copying from
> the Guide however I cannot get it to work.
>
> What am I missing?
>
> function drawVisualization() {
>> ...
>> ...
>> ...
>> table = new google.visualization.Table(document.getElementById('table1'));
>> table.draw(dataTable, {width: 1100});
>> google.visualization.events.addListener(table, 'ready', resizeTable);
>> }
>> function resizeTable() {
>> alert('Will this work?');
>> }
>
>
>
>
--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.