Extjs 'Ext.ux.DataView.Draggable' 初始化失败

标签 extjs view drag-and-drop draggable

我正在尝试将项目从 View 移动到另一个 View 或面板。

所有来源均指向Ext.ux.DataView.Draggable 。但这对我不起作用。

已关注 code from Extjs docs失败:

Ext.create('Ext.view.View', {
    mixins: {
        draggable: 'Ext.ux.DataView.Draggable'
    },

    initComponent: function() {
        this.mixins.draggable.init(this, {
            ddConfig: {
                ddGroup: 'someGroup'
            }
        });

        this.callParent(arguments);
    }
});

this.mixins.draggable 设置为未定义。所以找不到 init 方法。

错误日志:

Uncaught TypeError: Object Ext.ux.DataView.Draggable has no method 'init'

Ext.create.initComponent fiddle.jshell.net:28
Ext.define.constructor ext-all.js:15
b.callParent ext-all.js:15
Ext.define.constructor ext-all.js:15
Ext.Class.m ext-all.js:15
(anonymous function)
Ext.ClassManager.instantiate ext-all.js:15
(anonymous function) ext-all.js:15
window.onload

有什么简单的方法可以让它发挥作用吗?

编辑1:Here you can try it ;).

最佳答案

终于我明白了,感谢“Mitchell Simoens”,他在sencha 论坛上回答了同样的问题。通过这种方式,我发布了他的解决方案,我认为该解决方案做得很好:Ext.ux.DataView.Draggable failed to initialization !

用几句话回答: 使用 Ext.create 时,不应覆盖 initComponent 并设置 mixin,而应在 Ext.define 中执行此操作。 Example .

关于Extjs 'Ext.ux.DataView.Draggable' 初始化失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9588252/

相关文章:

element - 在 html 中嵌入 EXTJS 的正确方法

mysql - 如何使用 MySQL View 或过程模拟 Explode() 函数

jquery - 通过单击并拖动创建一个 div

java - 将 sqlite 中的数据放入 ArrayList<String>

对 hasMan 关系存储中的数据进行排序 Sencha Touch/ExtJS

javascript - Extjs 不显示来自商店的数据

Django:在重定向后保留捕获的参数

android - 无法使用此堆栈跟踪找到我崩溃的原因

python - PyQt 拖放 - 没有任何反应

javascript - 通过按 Enter 键而不是逗号将新值添加到标记字段