PDA

View Full Version : Touch 2.0.0.pr3 and Ext.draw.Component



meditecsports
23 Dec 2011, 2:52 AM
I'm trying to port an existing piece of code that worked using "Ext.draw.component" to work with Touch 2pr3. However, things don't look promising here. Specifically:

Rendering a widget using

Ext.create('Ext.draw.Component')
results in a huge pile of deprecation warnings:

[DEPRECATE][Ext.draw.Component#constructor] onRender() is deprecated, please put your code inside initialize() insteadsencha-touch-all-debug.js:21340[DEPRECATE][Ext.draw.Component#createSurface] 'el' is deprecated, please use 'element' insteadsencha-touch-all-debug.js:21340[DEPRECATE][Ext.draw.Surface.create] Ext.supports.Svg is deprecated, please use Ext.feature.has.Svg insteadsencha-touch-all-debug.js:21340[DEPRECATE][Ext.draw.Surface.create] Ext.supports.Vml is deprecated, please use Ext.feature.has.Vml insteadsencha-touch-all-debug.js:21340[DEPRECATE][Ext.draw.Component#constructor] initComponent() is deprecated, please put your code inside initialize() insteadsencha-touch-all-debug.js:21340[DEPRECATE][Ext.draw.Component#addEvents] addEvents() is deprecated. It's no longer needed to add events before firing

and subclassing it, like I used to do in ExtJS4:


Ext.define('My.Draw',{


extend: 'Ext.draw.Component',


config: {
width: 640, // width of the draw.Component
height: 480, // height of the draw.Component


...
},


constructor: function(cfg) {


this.initConfig();
...
}

results in getting lost in:

Uncaught TypeError: Cannot call method 'setWidth' of nullExt.define.doSetWidthsencha-touch-all-debug.js:37766(anonymous function)sencha-touch-all-debug.js:29640Base.implement.initConfigsencha-touch-all-debug.js:2845Ext.define.constructor...


Seeing this, I got the impression, that the "Ext.draw" tree of Touch is not really usable at this time (in pr3). Am I right?

And: If so, do you have an advise on how to proceed or what to wait for?

mitchellsimoens
23 Dec 2011, 7:30 AM
PR stages so expect a bumpy road still. Not sure why you are calling initConfig in the constructor, ST2 will do this for you.