开发者

ExtJs check if form values has changed

开发者 https://www.devze.com 2023-03-31 06:20 出处:网络
is there a possibility to check if 开发者_JAVA技巧form values has changed in ExtJs? ThanksmyForm.getForm().items.each(function(field){field.on(\'change\',function(f,n,o){alert(\'detected! \'+f.label+

is there a possibility to check if 开发者_JAVA技巧form values has changed in ExtJs?

Thanks


myForm.getForm().items.each(function(field){field.on('change',function(f,n,o){alert('detected! '+f.label+' value changed from '+o+' to '+n);});});

In the above snippet, what you are basically doing is -

  • Iterate over all fields in the form (myForm.getForm().items.each())
  • For each field, add a change listener. (field.on(...))
  • When a field's value is changed, the listener will be invoked with the field info and old and new value.
  • In the listener, change the alert with the appropriate logic.
0

精彩评论

暂无评论...
验证码 换一张
取 消