bind Control to Control - StringFilter to NumberRangeFilter

70 views
Skip to first unread message

Bassa Safa

unread,
Sep 4, 2012, 12:55:29 PM9/4/12
to google-visua...@googlegroups.com
I read in the documentation that binding Control to other Control in a dashboard is possible
https://code.google.com/apis/ajax/playground/?type=visualization#dependent_controls

I want to bind two StringFilterControl to a NumberRangeFilterControl. One StringFilterControl to the NumberRangeFilterControls min value and the other to the max value. Is it possible? If so... how do I bind?
dashboard.bind(stringfilterMin, numberrangefilter.lowValue).bind(stringfilterMax, numberrangefilter.highValue);
But this surprisingly didnt work =)

thank you in advance
bassa

asgallant

unread,
Sep 4, 2012, 1:07:38 PM9/4/12
to google-visua...@googlegroups.com
What you need to do is set up "statechange" event handlers for each StringFilterControl; in each handler, you call the #getState method of the ControlWrapper associated with the handler.  The state with contain a "value" parameter, which you can use to get whatever data you need from the DataTable to set the appropriate boundary of the NumberRangeFilter control.  Change the min/maxValue options of the NumberRangeFilter and then call the NumberRangeFilter's #draw method.
Reply all
Reply to author
Forward
0 new messages