1. #1
    Ext JS Premium Member meditecsports's Avatar
    Join Date
    Oct 2010
    Location
    Germany
    Posts
    47
    Vote Rating
    2
    meditecsports is on a distinguished road

      0  

    Default Touch 2.0.0.pr3 and Ext.draw.Component

    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
    Code:
    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:
    Code:
    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?

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,413
    Vote Rating
    1104
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default

    PR stages so expect a bumpy road still. Not sure why you are calling initConfig in the constructor, ST2 will do this for you.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1