Answered over on StackOverflow, for 
reference: http://stackoverflow.com/a/22153188/613559

On Monday, March 3, 2014 9:49:09 AM UTC-5, Sergey wrote:
>
> getFormattedValue expects a row as its first argument and the column as 
> its second argument. If you don't have a table that has as many columns as 
> it does rows, you probably want to do something like:
> var items = dataTable.getFormattedValue(i, columnNumberThatHasDuplicates);
>
> - Sergey
>
>
> On Mon, Mar 3, 2014 at 5:15 AM, Stelios Voskos 
> <[email protected]<javascript:>
> > wrote:
>
>>  I have a table and one of its columns has multiple duplicates. I want 
>> to filter all the rows that have the same value on the column at once. I 
>> tried to use the getFormattedValue() method which gets the value of a 
>> column and then applied the usual code for DataView. When I click on the 
>> row, it leveas jst the selected row of the table and it doesn't filter all 
>> the rows with the duplicate vale on the column. Here is my code so far:
>>
>>  var table = new 
>> google.visualization.Table(document.getElementById('chart_div'));var items = 
>> " ";
>>  table.draw(dataTable, {width: 1000, height: 300});
>> google.visualization.events.addListener(table, 'select',
>>     function(event) {
>>         var selection = table.getSelection();
>>         var view = new google.visualization.DataView(dataTable);
>>         for(i = 0; i < row.length; i++){
>>             var items = dataTable.getFormattedValue(i, i);
>>             if(items = "anti-social-behaviour"){
>>                 console.log("if statement");
>>                 view.setRows([selection[i].row]);
>>                 table.draw(view, []);
>>             }
>>         }
>>     });
>>
>> If anyone could spot the problem it wold be much appreciated. Thank you. 
>>  
>> -- 
>> 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]<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