say have form lot of elements.
i'd way through generic code, able add listeners these elements example, elements built-in focus event, text inputs or dropdowns, have onfocus listener. in rough pseudo-code, this:
for each element in document if hasbuiltinfocusevent(element) element.addlistener(element, 'focus', indicateonfocus); function indicateonfocus(element) { log(currenttime(), element.id, 'focus'); } ideally, without having modify existing class definitions of elements. can have code called once before form displayed set listeners.
please excuse general lack of knowledge. i'm interested in whether feasible, in particular avoiding having hardcode listener every element, because common generic method has numerous advantages.
focus changes reported globally in ext js out of box:
ext.on('focus', function(data) { console.log('focus changed ' + data.fromelement + ' ' + data.toelement); });
Comments
Post a Comment