Uncaught TypeError:无法读取未定义的属性'isSynchronized' [英] Uncaught TypeError: Cannot read property 'isSynchronized' of undefined

查看:829
本文介绍了Uncaught TypeError:无法读取未定义的属性'isSynchronized'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在排序ExtJS网格时遇到了问题。

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

网格加载情况良好,但当我尝试对列进行排序时,出现Uncaught TypeError:Can not read propertyisSynchronized '$ undefined错误。

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

addCls 会在鼠标移动时触发,当错误发生时, me.getData()返回 undefined ,其中 me p>

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

这是发生错误的 addCls 方法:

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

推荐答案

我覆盖了handleMouseDown方法并注释掉了快速提示部分。

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.

这篇关于Uncaught TypeError:无法读取未定义的属性'isSynchronized'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆