how to remove listener from cell editing plugin in ExtJs? -
can please me out here ?
i want remove beforeedit listener @ runtime cell editing plugin.
i added listener on plugin using following code.
var gridplugin = ext.getcmp(gridid).getplugin(pluginid); gridplugin.addlistener(eventname,function(editor,e,eopts){callbackfunction(editor, e, eopts);});
but not able remove listener.
i trying following code.
var gridplugin = ext.getcmp(gridid).getplugin(pluginid); gridplugin.removelistener(eventname);
thanks in advance,
ext.grid.plugin.cellediting.removelistener
's signature is: ( eventname, fn, [scope] )
(see documentation) means, apart supplying event name listener should detached, need provide listener function well. code should work be:
var gridplugin = ext.getcmp(gridid).getplugin(pluginid), listnerfunction = function(editor,e,eopts){callbackfunction(editor, e, eopts);} gridplugin.addlistener(eventname,listnerfunction);
then
var gridplugin = ext.getcmp(gridid).getplugin(pluginid); gridplugin.removelistener(eventname, listenerfunction);
note need have reference listenerfunction
available when detaching it.
Comments
Post a Comment