开发者

ExtJs check if form values has changed

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜