panel mit drag und drop funktioniert nicht in extjs 4.1

Dieser code arbeitet in Extjs 4.0.2 ein
aber wenn umgewandelt 4.1 es funktioniert nicht mehr und gibt eine Fehlermeldung

Uncaught TypeError: Cannot call method 'query' of undefined

Ext.onReady(function() {

    var panel = new Ext.Panel({
        renderTo: divtag,
        draggable: {
            insertProxy: false,
            onDrag: function(e) {
                var el = this.proxy.getEl();
                this.x = el.getLeft(true);
                this.y = el.getTop(true);
            },
            endDrag: function(e) {
                this.panel.setPosition(this.x, this.y);
            }
        },
        title: 'Panel',
        width: 200,
        height: 100,
        x: 20,
        y: 20
    });
});
  • Ich habe versucht, folgenden code, der funktioniert gut mit Komponente, aber nicht mit Panel 🙁 und wirft den Fehler : "Uncaught TypeError: Object [object object] has no method 'ensureAttachedToBody' Ext.onReady(function() { new Ext.Component({ constrain: true, title:'Test', floating: true, style: { backgroundColor: '#fff', border: '1px solid black' }, html: '<h1 style="cursor:move">The title</h1><p>The content</p>', draggable: { delegate:this.body } }).show(); });
InformationsquelleAutor jayesh | 2011-12-19
Schreibe einen Kommentar