dropdownlist in dojo?

3526
6
Jump to solution
11-10-2015 08:56 AM
LefterisKoumis
Occasional Contributor III

I know that the dropdownlist in dojo has been depreciated.

In flex, once a dropdownlist was clicked on, code could check if certain criteria were met and if not, the value of the list would not change.

I am trying to implement similar functionality with dojo/select however, the absence of the "break" to exit a function in dojo, makes this more complex.

In dojo, once you click on the select list. it allows the user to change its value.

A solution is to store the current value of the select list, and if criteria are not met, then revert the select list to its original value.

Any other more simple solutions?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   OK in that case then here is a updated fiddle that shows that.

get previous value of dijit - JSFiddle

View solution in original post

6 Replies
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   Here is a fiddle that demos how to check the selects value and prevent it from being selected if it meets a certain value:

get previous value of dijit - JSFiddle

LefterisKoumis
Occasional Contributor III

Thank you Robert.

I have to work with it. I actually try to compare the values of two select objects to ensure that no identical values are selected. Both select objects carry the same options.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Lefteris,

   OK in that case then here is a updated fiddle that shows that.

get previous value of dijit - JSFiddle

LefterisKoumis
Occasional Contributor III

Thank you!

0 Kudos
MihkelMänna
Occasional Contributor

I am using this approach to create custom repopulating dropdowns in my Query widget. When the watch handler is triggered, a new paramsDijit is built using this.paramsDijit.build().

Everything is working fine, but I'm unable to figure out how to add the watch handler to the new paramsDijit after it is added to DOM. Also, will the watch handler be removed from the destroyed dropdown elements?

I'd be grateful if anyone could point me in the right direction.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Mihkel,

   The watch would have to applied to the select element inside your paramsDijit. As far as the watch being removed when the select element is destroyed, I think so.

0 Kudos