Last active
October 4, 2022 22:08
-
-
Save chrisdiana/8d7985e9b06dfbb792a8 to your computer and use it in GitHub Desktop.
Detect field change in ExtJS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var panel = new Ext.form.FormPanel({ | |
title: 'Example', | |
width: 350, | |
items: [], | |
listeners: { | |
add: function(me, component, index) { | |
component.on('change', function(f,n,o) { | |
alert('detected! '+f.label+' value changed from '+o+' to '+n); | |
console.log(component.startValue); | |
}); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example on render or load | |
example.form.load({ | |
url: '/my/api', | |
params: {id: 5}, | |
success: function(result, request) { | |
var form = example.getForm(); | |
form.items.each(function(field){ | |
field.on('change',function(f,n,o){ | |
alert('detected! '+f.label+' value changed from '+o+' to '+n); | |
}); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment