简体   繁体   中英

Dojo 1.4: Reset dijit.form.FilteringSelect value to previous value onChange

http://jsfiddle.net/FYtJH/1

The filtering select needs to warn users that they're about to change the select and if they cancel, reset the value to the previous one.

  1. Am I connecting to the right events?
  2. The OnBlur event retriggers the change event. If the widget is still focused when I reset the value and you click anywhere outside the widget, it triggers the onchange event again. I'd like to prevent that. Is there a way to set the value but prevent the onChange from firing when blurring the input?

TLDR: Reset filteringSelect to old value and unfocus the widget using confirm dialog.

我错过了明显的解决方法-我将旧值保存在本地变量中-如果将其与传入值进行比较,并在此处暂停onChange功能,则可以解决onBlur问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM