newsAnand
19 Dec 2011, 2:35 AM
This code is working in Extjs 4.0.2a but when converted to 4.1 (http://www.sencha.com/blog/ext-js-4-1-developer-preview/) it no longer works and gives an error like:
Uncaught TypeError: Cannot call method 'query' of undefined
My Code is:
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
});
});
Uncaught TypeError: Cannot call method 'query' of undefined
My Code is:
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
});
});