查找EXT-ALL-debug.js源誤差的方法,然後創建一個新的JS進入「EXT-所有*的js。」加載後位置,我的版本是:Ext JS 6.2.0.981
核心代碼是:Object。 prototype
。功能和xxx != null
後綴代碼:
Ext.event.publisher.Dom.prototype.unsubscribe = function (element, eventName, delegated, capture) {
var me = this,
captureSubscribers, bubbleSubscribers, subscribers, id;
if (delegated && !me.directEvents[eventName]) {
captureSubscribers = me.captureSubscribers;
bubbleSubscribers = me.bubbleSubscribers;
subscribers = capture ? captureSubscribers : bubbleSubscribers;
if (subscribers != null && subscribers[eventName]) {
--subscribers[eventName];
}
if (me != null && bubbleSubscribers != null && captureSubscribers != null && !me.handles[eventName] && !bubbleSubscribers[eventName] && !captureSubscribers[eventName]) {
// decremented subscribers back to 0 - and the event is not in "handledEvents"
// no longer need to listen at the dom level
this.removeDelegatedListener(eventName);
}
} else {
subscribers = capture ? me.directCaptureSubscribers : me.directSubscribers;
id = element.id;
subscribers = subscribers[eventName];
if (subscribers[id]) {
--subscribers[id];
}
if (!subscribers[id]) {
// no more direct subscribers for this element/id/capture, so we can safely
// remove the dom listener
delete subscribers[id];
me.removeDirectListener(eventName, element, capture);
}
}
};
謝謝。這個解決方案適合我:) –