-
-
Save wujku/cc2c0c5747f59b839bb54608e2db5a5e to your computer and use it in GitHub Desktop.
Detect field change in ExtJS
This file contains 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 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