2

I'm trying to D-n-D items from View to another View or Panel.

All sources points to Ext.ux.DataView.Draggable. But it doesn't work for me.

Following code from Extjs docs fails:

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 set as undefined. So init method not found.

Error logs:

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

Is there any simple way to get it worked ?

Edit1: Here you can try it ;).

2 Answers 2

2

Finally I have got it and thanks for 'Mitchell Simoens' who have answered same question on sencha forum. In this way I publish his solution, whose I think is well done: Ext.ux.DataView.Draggable failed to initialization !

Answer in few words: You shouldn't override initComponent and set the mixins when using Ext.create, you should do that in Ext.define. Example.

Sign up to request clarification or add additional context in comments.

Comments

0

I think you may need to look at: Ext.dd.DragZone - documentation link. Ext.ux.DataView.Draggable does state that it requires it to work, and it does contain your missing init function. Hope that helps.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.