0
votes

I have a select component which has two options and a button. According to the options in the select component charts will be displayed in the dashboard. "Option1" in the drop down list is the default option so in the click action of the button I have written the following code to make "Option1" the first option.

$("#LongestActivation_LongestTypeDD option:first").attr("selected", true);  

As soon an option is selected from the select component a javascript code is fired. But when I have the above code it does not get fired the first time but only gets fired the second time. Is there any other way I can make "Option1" the default option without using the above code?

1
Is that a select component or a checkbox component? - nsousa
It's a select component - Sindu_
on the postFetch method try Dashboards.fireChange( this.parameter, this.queryState.lastResults().resultset[0][0] ). - nsousa

1 Answers

0
votes

I had the same problem. I use a trick, add a first element into "values array" with no text and the same id that your default.

enter image description here The problem with my solution the selector is clicked, an empty first options is showed.