Results 1 to 6 of 6

Thread: e.onRedraw is not a function when running the builded application

  1. #1
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77

    Default e.onRedraw is not a function when running the builded application

    I'm building my Architect application, to a production env, with Sencha CMD. The process runs with success, but when I'm running my application I'm getting some javascript errors:

    TypeError: e.onRedraw is not a function
    TypeError: b.setOwner is not a function

    I'm referencing all-classes.js, resources/app-all.css and ext-theme-neptune.js in the production page.

    What can I do to debug this production env and find the cause? Im following the process described in this topic.

    Sencha cmd version 3.1.2.342
    ext-4.2.1.883 (evaluating the commercial license)

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748

    Default

    This is probably a missing requires. Can you tell what type of object this is supposed to be? From the looks of the methods it could be a layout object or something like that.

  3. #3
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77

    Default

    Hi. After running the deploy to the "testing" environment I figured out that I need this requires:

    Code:
    Ext.require('Ext.chart.series.Column');
    Ext.require('Ext.chart.axis.Category');
    Ext.require('Ext.chart.axis.Numeric');
    Ext.require('Ext.form.Panel');
    Ext.require('Ext.layout.container.Column');
    Ext.require('Ext.form.field.*');
    Ext.require('Ext.grid.Panel');
    Ext.require('Ext.grid.column.*');
    Ext.require('Ext.tab.Panel');
    Ext.require('Ext.form.FieldSet');
    My code (generated by Sencha Architect) use nested components, declared with "xtype". Shouldn't Sencha Cmd handle this?

  4. #4
    Sencha User
    Join Date
    Jul 2009
    Location
    Kansas
    Posts
    1,748

    Default

    There is a good bit of auto-dependency detection in Cmd but it seems that the way in which these dependencies are encountered is not detected. If you want to post a snippet of code where one of these non-detected things is referenced that might shed light. For example, Cmd detects "xtype" property usages as a way to know what classes are required.

  5. #5
    Sencha User
    Join Date
    Mar 2007
    Posts
    792

    Default

    the solution to build the app with chart was:

    Add Ext.chart.* to the require config of the Application node it solves the problem.

    thanks
    Frank

  6. #6
    Sencha User
    Join Date
    May 2010
    Location
    Sapiranga, Rio Grande do Sul, Brazil
    Posts
    77

    Default

    This is my Viewport (generated by Architect):

    Code:
    Ext.define('MyApp.view.AppViewport', {
        extend: 'Ext.container.Viewport',
    
    
        border: true,
        cls: '',
        id: 'app-viewport',
        padding: '40 5 5 5',
        layout: {
            type: 'border'
        },
    
    
        initComponent: function() {
            var me = this;
    
    
            Ext.applyIf(me, {
                style: {
                    background: '#3892D3'
                },
                items: [
                    {
                        xtype: 'container',
                        region: 'center',
                        layout: {
                            type: 'border'
                        },
                        items: [
                            {
                                xtype: 'panel',
                                region: 'west',
                                split: true,
                                width: 250,
                                layout: {
                                    type: 'accordion'
                                },
                                collapsed: false,
                                collapsible: true,
                                title: 'Menu',
                                items: [
                                    {
                                        xtype: 'treepanel',
                                        id: 'programasTree',
                                        title: 'Programas',
                                        store: 'MyTreeStore',
                                        rootVisible: false,
                                        viewConfig: {
                                            id: 'programastree'
                                        }
                                    },
                                    {
                                        xtype: 'panel',
                                        border: false,
                                        title: 'Favoritos'
                                    },
                                    {
                                        xtype: 'panel',
                                        border: false,
                                        title: 'Recentes'
                                    }
                                ]
                            },
                            {
                                xtype: 'panel',
                                region: 'center',
                                cls: 'x-portal',
                                id: 'app-portal',
                                layout: {
                                    align: 'stretch',
                                    type: 'vbox'
                                },
                                bodyCls: [
                                    'x-portal-body',
                                    'x-panel-body-default',
                                    'x-box-layout-ct'
                                ],
                                dockedItems: [
                                    {
                                        xtype: 'toolbar',
                                        dock: 'top',
                                        id: 'defaultToolbar',
                                        items: [
                                            {
                                                xtype: 'button',
                                                iconCls: 'icon-fav',
                                                text: 'Favoritar'
                                            },
                                            {
                                                xtype: 'button',
                                                iconCls: 'icon-logout',
                                                text: 'Sair'
                                            },
                                            {
                                                xtype: 'tbseparator'
                                            },
                                            {
                                                xtype: 'tbspacer',
                                                flex: 1
                                            },
                                            {
                                                xtype: 'textfield',
                                                id: 'codPrograma',
                                                fieldLabel: 'Abrir Programa',
                                                labelWidth: 95,
                                                name: 'codPrograma'
                                            },
                                            {
                                                xtype: 'button',
                                                id: 'abrirPrograma',
                                                iconCls: 'icon-abrir-programa',
                                                text: ''
                                            }
                                        ]
                                    },
                                    {
                                        xtype: 'toolbar',
                                        flex: 1,
                                        dock: 'bottom',
                                        height: 40,
                                        id: 'programasToolbar'
                                    }
                                ],
                                items: [
                                    {
                                        xtype: 'panel',
                                        flex: 1,
                                        border: false,
                                        frame: true,
                                        height: 323,
                                        id: 'informacoesPanel',
                                        margin: '10 10 10 0',
                                        padding: '',
                                        layout: {
                                            type: 'fit'
                                        },
                                        closable: true,
                                        title: 'Informaes Gerenciais',
                                        items: [
                                            {
                                                xtype: 'panel',
                                                margin: '5 5 5 5',
                                                layout: {
                                                    type: 'fit'
                                                },
                                                title: 'Acessos Por Tipo de Pessoa',
                                                items: [
                                                    {
                                                        xtype: 'chart',
                                                        height: 250,
                                                        margin: '10 10 10 10',
                                                        width: 400,
                                                        animate: true,
                                                        insetPadding: 40,
                                                        store: 'AcessosTipoPessoa',
                                                        axes: [
                                                            {
                                                                type: 'Category',
                                                                fields: [
                                                                    'descr'
                                                                ],
                                                                title: 'Tipo de Pessoa',
                                                                position: 'bottom'
                                                            },
                                                            {
                                                                type: 'Numeric',
                                                                fields: [
                                                                    'acessos'
                                                                ],
                                                                title: 'Acessos',
                                                                adjustMaximumByMajorUnit: true,
                                                                decimals: 0,
                                                                minimum: 0,
                                                                position: 'left'
                                                            }
                                                        ],
                                                        series: [
                                                            {
                                                                type: 'column',
                                                                renderer: function(sprite, record, attributes, index, store) {
                                                                    var colors = ['#F2C72B','#a5c249','#E88712','#9D5FFA'];
                                                                    attributes.fill = colors[index%colors.length];
                                                                    return attributes;
                                                                },
                                                                label: {
                                                                    display: 'outside',
                                                                    color: '#000',
                                                                    field: 'acessos'
                                                                },
                                                                xField: 'descr',
                                                                yField: 'acessos'
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    }
                ]
            });
    
    
            me.callParent(arguments);
        }
    
    
    });

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •