View • Edit • • • Log In •
Jun 20, 2008
One of the great things about the CDF is the concept of listeners, where you can easily set components like charts to listen on the controls like select lists. These charts update automatically when the listener is changed, which is an awesome feature.
But there are cases where you don't want this behavior. When you're selecting interim lists of values or even under the date picker, constant refreshing can slow the user experience. How do you change this feature in cases where you want the charts to be refreshed on demand by the user on the click of a button? Try this:
1. Add a button in the desired location for your selected dashboard in template.html, and include a reference to a function that you'll create. This function could be named anything, in this example it's called "refresh_charts()"
<"BUTTON" name="refresh" value="Refresh" OnClick="refresh_charts()">
2. Remove the listeners from your chart component in template.html. It should look something like this:
3. Then at the bottom on your template.html, below the load() function, add the function specified earlier in the button to refresh the charts. In this case, it refreshes chart_a, specified above in step 2.
That should work. Give it a try and see if it works for you.
Aug 28, 2008
In step number one I think there is a little mistake: I think that you have to put the button like this
<input type="button" name="refresh" value="Refresh" OnClick="refresh_charts()" />
Please do not leave comments on Wiki pages asking for help. They will be deleted. Use the forums instead.