Oh, you want to implement a select event in your chart/table, not the
control. Here's example code you can plug into the playground code for the
StringFilter
control<https://code.google.com/apis/ajax/playground/?type=visualization#stringfilter_control>
:
google.visualization.events.addListener(table, 'select', function () {
var sel = table.getChart().getSelection();
var tmpData = table.getDataTable();
var msgArray = ['You have selected:'];
for (var i = 0; i < sel.length; i++) {
msgArray.push(tmpData.getValue(sel[i].row, 0));
}
alert(msgArray.join('\n'));
});
Put that in the code after you create the table and before you create the
dashboard.
On Saturday, January 12, 2013 8:57:04 AM UTC-5, [email protected] wrote:
>
> Why not?
> If for example I want to have a table of people (with name, id, etc.) and
> when clicking on someone I want something specific to happen (or at least
> be able to read the id, first name, etc)
>
> On Friday, January 11, 2013 9:59:40 PM UTC+2, asgallant wrote:
>>
>> There isn't anything to select in a StringFilter control, perhaps what
>> you want is the "statechange" event, which gets fired every time the user
>> interacts with the control?
>>
>> On Friday, January 11, 2013 8:44:27 AM UTC-5, [email protected] wrote:
>>>
>>> How can I add a select event to the StringFilter? (
>>> https://code.google.com/apis/ajax/playground/?type=visualization#stringfilter_control
>>> )
>>> (like it's done here:
>>> https://code.google.com/apis/ajax/playground/?type=visualization#select_eventbut
>>> for a simple table).
>>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/n4dmEWsnn38J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.