extjs Ext JS 7.4.0 Modern外部数据视图导航模型的onChildTrigger中的变量用法错误

1u4esq0p  于 2022-11-04  发布在  其他
关注(0)|答案(1)|浏览(177)

我在新的 Sencha 7.4现代版的这部分代码中得到了一个错误。请参见代码中我的注解。

onChildTrigger: function(view, location) {
        var e = location.event,
            isFocusingEvent = (e.type === ((e.pointerType === 'touch') ? 'tap' : 'touchstart'));

        // i am getting an error here
        // shouldn't it be e.target.id ?
        if (event.target.id === location.child.id) { 
            this.handleLocationChange(location, {
                event: e
            });
            return;
        }

        if (isFocusingEvent) {
            this.handleChildTrigger(view, location);
        } else {
            this.doHandleChildTrigger(view, location);
        }
    },

我可以在哪里报告关于 Sencha 框架的bug?论坛说他们转移到了stackoverflow?

t2a7ltrp

t2a7ltrp1#

如上所述,您输入了错误的event。下面的代码非常有效:

listeners: {
        childtap: function (grid, location) {
            var e = location.event,
            isFocusingEvent = (e.type === ((e.pointerType === 'touch') ? 'tap' : 'touchstart'));

            if (e.target.id === location.child.id) { 
                console.log('handleLocationChange');
                /*
                    this.handleLocationChange(location, {
                        event: e
                    });
                */
                return;
            }

            if (isFocusingEvent) {
                console.log('isFocusingEvent');
                // this.handleChildTrigger(view, location);
            } else {
                console.log('isNotFocusingEvent');
                //this.doHandleChildTrigger(view, location);
            }
        }
    },

相关问题