getFilteredRows for datatype string

875 views
Skip to first unread message

c2billp

unread,
Jan 15, 2010, 4:59:35 PM1/15/10
to Google Visualization API
I have an application which uses:
google.visualization.events.addListener(table, 'select', function
(event)

to determine the selected value from a column - then apply this value
to filter a view which in turn drives a chart of the subset of
matching rows.

http://www.logsitall.com/jswrite2-better.asp

I have two questions:

1. This command

view.setRows(view.getFilteredRows([{column: 1, value: data.getValue
(item.row, 1)}]));

works - as long as the column in question returns a numeric value. I
can not sort out how to use the data.getValue to function when the
returned value is a string.

2. I'd like to allow the user to select any value in any column and
use this value/column information to filter the view that drives the
chart - however each time i've tried to use a variation of:

view.setRows(view.getFilteredRows([{column: item.column, value:
data.getValue(item.row, item.Column)}]));

the item.column value comes back null and the function fails.

Thank you very much in advance.

-bill

Viz Kid

unread,
Jan 19, 2010, 11:34:52 AM1/19/10
to google-visua...@googlegroups.com

Hi Bill.

As for your first question, this should work. You can pass a string argument in the value and the filter works fine and you can also use the data.getValue method.

Currently the Table object only supports row selection and therefore the column property is always undefined. If this is important for you, you can catch these events by yourself by adding some special html code int he formatted value of each cell.

Hope this helps,
  Viz Kid

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.




Reply all
Reply to author
Forward
0 new messages