PDA

View Full Version : plugin that overrides components listeners ext4.2



michaelbdavid
24 Mar 2017, 3:08 PM
Hello All,

I'm currently looking into creating a plugin to add additional radio fields to a radioGroup. This all works fine but due to on change listeners on the radioGroup when I click my added radio field the components listener resets the selection. Is there a way inside of my plugin to override the existing component listeners so that when my plugin is applied I can supply custom on change behavior so that the parent components on change listener can be ignored?

Thanks for the help in advance,
Michael

Gary Schlosberg
24 Mar 2017, 4:01 PM
Can you call suspendEvents and resume them after?
http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.util.Observable-method-suspendEvents

michaelbdavid
27 Mar 2017, 9:53 AM
Hi Gary,

Thanks for the reply. I dont think this will work as I'd like to piggy back on the existing listeners under certain circumstances and then override under others. If I understand suspendEvents correctly this would only prevent events from getting fired. I would like to override within my plugin when my new radioField is selected and continue with existing behavior in the parent component when existing radioFields are selected.


Can you call suspendEvents and resume them after?
http://docs.sencha.com/extjs/4.2.6/#!/api/Ext.util.Observable-method-suspendEvents