egorfine
23 Feb 2012, 6:26 AM
Ext.define('common.Connection', {
singleton: true,
mixins: {
observable: 'Ext.util.Observable'
},
socket: null,
constructor: function() {
this.addEvents(['offline','connecting', 'online']);
Ext.onReady(Ext.bind(function() {
this.fireEvent('connecting');
this.socket = io.connect(null);
this.socket.on('error', Ext.bind(this.onError, this));
}, this));
},
onError: function(reason) {
this.fireEvent('offline', reason);
}
});
This code worked perfectly in ExtJS 4.0.7, 4.1b1 and 4.1b2, but fails on ExtJS 4.1b3 in Observable.js line 444.
Adding "hasListeners: {}" into class fixes it and everything seems working.
A bug?
singleton: true,
mixins: {
observable: 'Ext.util.Observable'
},
socket: null,
constructor: function() {
this.addEvents(['offline','connecting', 'online']);
Ext.onReady(Ext.bind(function() {
this.fireEvent('connecting');
this.socket = io.connect(null);
this.socket.on('error', Ext.bind(this.onError, this));
}, this));
},
onError: function(reason) {
this.fireEvent('offline', reason);
}
});
This code worked perfectly in ExtJS 4.0.7, 4.1b1 and 4.1b2, but fails on ExtJS 4.1b3 in Observable.js line 444.
Adding "hasListeners: {}" into class fixes it and everything seems working.
A bug?