Try this:

// rowIndex is the row index you want to pull data from - you can loop this 
if you need to pull multiple rows
var json = dataToAdd.toJSON();
data.addRow(json.rows[rowIndex].c);
json = null;

This exploits the structure of the JSON representation of the DataTable - 
which is part of the public face of the API, so you can count on it being 
stable.  If you are pulling these from an AJAX query, you can actually skip 
creating a DataTable object entirely and just pull the row directly from 
the JSON.

On Wednesday, July 3, 2013 9:05:07 PM UTC-4, Tristan Chapo wrote:
>
> Agreed.
> What would you recommend then ?
>
> I send several asynchronous queries to the server (which sends me back one 
> datatable per query) and add them to my summary table as they come back.
> I know the line I want to extract in each query.
>
>
>
> On Thu, Jul 4, 2013 at 12:19 AM, asgallant 
> <[email protected]<javascript:>
> > wrote:
>
>> That looks like the Java API, not the JavaScript API.  Be careful using 
>> shortcuts like that - the internal workings of the API are subject to 
>> change at any time, so updates can break your code if you depend on them.
>>
>>
>> On Tuesday, July 2, 2013 7:38:37 PM UTC-4, Tristan Chapo wrote:
>>
>>> Ah OK. So what is my link describing? 
>>> I found a workaround by using the ".K" property. 
>>> On 3 Jul 2013 01:10, "asgallant" <[email protected]> wrote:
>>>
>>>>  There is no DataTable#getRow method.  What is the ultimate goal you 
>>>> are trying to accomplish here?  Copying data from one DataTable to another 
>>>> is rarely the best way to approach a problem, so there might be a simpler 
>>>> solution waiting for you.
>>>>
>>>> On Monday, July 1, 2013 11:44:48 PM UTC-4, Tristan Chapo wrote:
>>>>>
>>>>> Here is my code :
>>>>>
>>>>> <script type="text/javascript" src="https://www.google.com/**js**api 
>>>>> <https://www.google.com/jsapi>"></script>
>>>>> google.load('visualization', '1',{'packages': ['table']});
>>>>>
>>>>> and then later on (both data and dataToAdd are D****ataTable()):
>>>>>
>>>>> data.addRow(dataToAdd.getRow(**0**));   
>>>>>
>>>>>
>>>>> On Tuesday, July 2, 2013 11:04:15 AM UTC+8, Tristan Chapo wrote:
>>>>>>
>>>>>> Hello Everyone,
>>>>>>
>>>>>> I was trying to use the getRow() method : The function in question 
>>>>>> is 
>>>>>> here<https://developers.google.com/chart/interactive/docs/dev/dsl_javadocs/com/google/visualization/datasource/datatable/DataTable#getRow(int)>
>>>>>> .
>>>>>> But when running my webpage I get "Uncaught TypeError: Object #<U> 
>>>>>> has no method 'getRow' ".
>>>>>>
>>>>>> Has this function been deprecated ? If not, how can I make sure I can 
>>>>>> use it ?
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>>
>>>>>>
>>>>>>  -- 
>>>> You received this message because you are subscribed to a topic in the 
>>>> Google Groups "Google Visualization API" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/**
>>>> topic/google-visualization-**api/m12BbSUmQc0/unsubscribe<https://groups.google.com/d/topic/google-visualization-api/m12BbSUmQc0/unsubscribe>
>>>> .
>>>> To unsubscribe from this group and all its topics, send an email to 
>>>> google-visualization-api+**[email protected].
>>>> To post to this group, send email to google-visua...@**googlegroups.com
>>>> .
>>>>
>>>> Visit this group at http://groups.google.com/**
>>>> group/google-visualization-api<http://groups.google.com/group/google-visualization-api>
>>>> **.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>  -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Google Visualization API" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/google-visualization-api/m12BbSUmQc0/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To post to this group, send email to 
>> [email protected]<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
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.


Reply via email to