Uncaught TypeError: Cannot read property 'isSynchronized' of undefined

折月煮酒 提交于 2019-12-11 03:49:11

问题


I have a problem with sorting my ExtJS grid. I'm using Ext JS version 5.1.1.451.

The grid loads well but when I try to sort the columns I get the "Uncaught TypeError: Cannot read property 'isSynchronized' of undefined" error.

The method addCls is triggered on mouse movement and when the error occures, me.getData() returns undefined, where me is

constructor
$observableInitialized: true
component: constructor
config: Object
destroy: () {}
dom: null
el: null
events: Object
hasListeners: statics.prepareClass.HasListeners
id: "ext-quicktips-tip"
initConfig: () {}
initialConfig: Object
isDestroyed: true
lastBox: null
managedListeners: Array[0]
shadow: null

This is the addCls method where the error occurs:

addCls: function(names, prefix, suffix) {
        var me = this,
            elementData = me.getData(),
            hasNewCls, dom, map, classList, i, ln, name;
        if (!names) {
            return me;
        }
        if (!elementData.isSynchronized) {
            me.synchronize();
        }

Has anyone encounter this problem before? Is it a known issue or am I doing something wrong?

Thank you


回答1:


I've overriden the handleMouseDown method and commented out the quick tips part.

Ext.override(Ext.dd.DragDropManager, {
    handleMouseDown: function (e, oDD) {
        var me = this,
            xy, el;
        me.isMouseDown = true;
        //if (Ext.quickTipsActive) {
        //    Ext.tip.QuickTipManager.ddDisable();
        //}
        me.currentPoint = e.getPoint();
        if (me.dragCurrent) {
            me.handleMouseUp(e);
        }
        me.mousedownEvent = e;
        me.currentTarget = e.getTarget();
        me.dragCurrent = oDD;
        el = oDD.getEl();


        Ext.fly(el).setCapture();


        xy = e.getXY();
        me.startX = xy[0];
        me.startY = xy[1];


        me.offsetX = me.offsetY = 0;
        me.deltaX = me.startX - el.offsetLeft;
        me.deltaY = me.startY - el.offsetTop;
        me.dragThreshMet = false;
    }
});

If anyone has a better answer, post it and I will mark it if it's good.



来源:https://stackoverflow.com/questions/31052434/uncaught-typeerror-cannot-read-property-issynchronized-of-undefined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!