1. #1
    Sencha User liliam.romero's Avatar
    Join Date
    Oct 2014
    Posts
    13
    Vote Rating
    0
    liliam.romero is on a distinguished road

      0  

    Default Answered: How migrate Ext to Sencha

    hello!!!




    I have a project in Ext, I need to know how to migrate this code to sencha tocuh 2.3.
    here's an example of the code
    Code:
    Ext.onReady(function() {
    var botones_pagina = Ext.widget({
    xtype: 'form',
    layout: 'form',
    id: 'botones_pagina',
    renderTo: Ext.getBody(),
    bodyPadding: '5 5 0',
    border:false,
    width: '100%',
    items: [],
    buttons: []
    })
    };
    Appreciate your help!!!!

  2. The API between Ext JS and Sencha Touch have some differences. There are too many to easily say what they are here, you will need to check the API doc for what you can do with Sencha Touch.

    For this small code, you can do:

    Code:
    Ext.Viewport.add({
        xtype : 'formpanel',
        items : []
    });
    In Touch, there is no form layout (this isn't required in Ext JS either), you don't use renderTo, there is no bodyPadding or border and there is no buttons config. For bodyPadding, you can add the cls config to the formpanel and then use CSS to target the element to add padding, there is a padding config that you can use but that will likely affect any docked toolbars. For the buttons config, you can add a docked toolbar in the items array:

    Code:
    items : [
        {
            xtype : 'toolbar',
            docked : 'bottom',
            items : [
                {
                    text : 'Foo'
                }
            ]
        }
    ]

  3. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    38,546
    Vote Rating
    1120
    Answers
    3700
    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

    The API between Ext JS and Sencha Touch have some differences. There are too many to easily say what they are here, you will need to check the API doc for what you can do with Sencha Touch.

    For this small code, you can do:

    Code:
    Ext.Viewport.add({
        xtype : 'formpanel',
        items : []
    });
    In Touch, there is no form layout (this isn't required in Ext JS either), you don't use renderTo, there is no bodyPadding or border and there is no buttons config. For bodyPadding, you can add the cls config to the formpanel and then use CSS to target the element to add padding, there is a padding config that you can use but that will likely affect any docked toolbars. For the buttons config, you can add a docked toolbar in the items array:

    Code:
    items : [
        {
            xtype : 'toolbar',
            docked : 'bottom',
            items : [
                {
                    text : 'Foo'
                }
            ]
        }
    ]
    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.

  4. #3
    Sencha User liliam.romero's Avatar
    Join Date
    Oct 2014
    Posts
    13
    Vote Rating
    0
    liliam.romero is on a distinguished road

      0  

    Default

    thank you very much.

Thread Participants: 1