PDA

View Full Version : Stateful requirements



raphael.franchet
27 May 2015, 11:51 PM
According to https://www.sencha.com/forum/showthread.php?301445-Stateful-private, Stateful was made private in extjs 6.0.0 by mistake.

But if this class is public, I have a few problem with it.
My point is I want to use it with a class that is not a component, and it only works with components now (was ok in extjs 4.2.3).

Indeed, this mixin requires that my class have the getPlugins method AND the hasListeners object.

Stateful.js line 210 and line 281

hasListeners = me.hasListeners,
should be replaced by

hasListeners = me.hasListeners ||{},

Stateful.js line 223

plugins = me.getPlugins() || [];
should be replaced by

plugins = (Ext.isFunction(me.getPlugins) ? me.getPlugins() : []) || [];

mitchellsimoens
1 Jun 2015, 12:32 PM
Ext.state.Stateful is designed with it being mixed into a Component in mind. The hasListeners is setup by mixing Ext.mixin.Obervable into the class.