There is no way to access the internal variables of a function from outside
that function. Do you specifically need a count of the rows in the
DataTable or would a count of rows in the HTML table suffice? If the
latter is goo enough, then you can use this to get the count of rows:
var rowCount = document.querySelectorAll('#myTable tr').length - 1; //
subtract 1 since the first row is a header
where "myTable" is the id of the table's container div.
On Wednesday, November 27, 2013 6:51:57 AM UTC-5, Pushpendra Singh wrote:
>
> Hi,
>
> I have one function which create the google.visualization.Table and add
> rows to it.
>
> Now i have one button on the same page and i need to get the no. of rows
> in that table.
>
> var gogdata = new google.visualization.DataTable();
>
> Certainly, i can make the 'var gogdata' var as global and access the
> *getNumberOfRows
> <https://developers.google.com/chart/interactive/docs/dev/dsl_javadocs/com/google/visualization/datasource/datatable/DataTable.html#getNumberOfRows()>*
> () but i dont want to make it global as i have many table. Is there a
> way though which if i pass an ID associated with the table, it gives me the
> table instace and then i can use the function *getNumberOfRows
> <https://developers.google.com/chart/interactive/docs/dev/dsl_javadocs/com/google/visualization/datasource/datatable/DataTable.html#getNumberOfRows()>*
> ()
>
> regards
> Pushpendar
>
--
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.