Results 1 to 2 of 2

Thread: Nav Tree Code generated by Architect does not work, but hand generated code does

  1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    10

    Default Nav Tree Code generated by Architect does not work, but hand generated code does

    I am currently evaluating Sencha Architect 3 for code development.  Prior to using this tool, I was just writing the Javascript code by hand. I started off with a TreePanel project that will be used for navigation.
    The code generated by had works fine. The navigation tree appears on screen as expected. The code generated by Architect errors out with the following message:

    TypeError: Ext.grid.ColumnManager is not a constructor
    me.grid.columnManager = me.columnManager = new Ext.grid.ColumnManager(me);

    I'm not doing anything with columns, so I'm lost as to where this error is coming from
    Here is the code generated by Architect

    Code:
    Ext.define('Scada.view.workbench.MainContainer', {
        extend: 'Ext.container.Container',
        alias: 'widget.mainviewer',
    
        requires: [
            'Scada.view.workbench.TreePanel',
            'Ext.tree.Panel',
            'Ext.layout.container.Border',
            'Ext.resizer.BorderSplitterTracker'
        ],
    
        height: 600,
        width: 800,
        layout: 'border',
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'treestorepanel',
                        collapsible: true,
                        title: 'Application',
                        region: 'west',
                        split: true,
                        splitterResize: false
                    },
                    {
                        xtype: 'panel',
                        flex: 1,
                        region: 'center',
                        itemId: 'mainpanelholder',
                        layout: 'fit'
                    }
                ]
            });
    
            me.callParent(arguments);
        }
    
    });
    Code:
    Ext.define('Scada.store.workbench.NavTree', {
        extend: 'Ext.data.TreeStore',
    
        requires: [
            'Ext.util.Sorter',
            'Ext.data.proxy.Ajax'
        ],
    
        constructor: function(cfg) {
            var me = this;
            cfg = cfg || {};
            me.callParent([Ext.apply({
                autoLoad: false,
                storeId: 'workbench.NavTree',
                folderSort: true,
                root: {
                    text: 'Application',
                    id: 'navtree',
                    expanded: true
                },
                sorters: {
                    property: 'text'
                },
                proxy: {
                    type: 'lJWSNavProxy'
                }
            }, cfg)]);
        }
    });
    Code:
    Ext.define('Scada.view.workbench.TreePanel', {
        extend: 'Ext.tree.Panel',
        alias: 'widget.treestorepanel',
    
        height: 250,
        width: 200,
        title: 'My Tree Panel',
        store: 'workbench.NavTree',
        singleExpand: true,
        useArrows: true,
    
        initComponent: function() {
            var me = this;
    
            Ext.applyIf(me, {
                viewConfig: {
                    plugins: {
                        ptype: 'treeviewdragdrop'
                    }
                }
            });
    
            me.callParent(arguments);
        }
    
    });
    Code:
    Ext.define('Ext.data.proxy.Scada', {
        extend: 'Ext.jws.data.Proxy',
        alias: 'proxy.lJWSNavProxy',
        requires: [
            
            'Ext.jws'
        
        ],
        config:{
            ns: 'org.jwebsocket.plugins.scada.nav',
            api: {
                create:  'create',
                read:    'read',
                update:  'update',
                destroy: 'destroy'
           },
                reader:{
                type: 'json',
                root: 'data',
                totalProperty: 'totalCount'
    
            },
            
            writer: {
                        type: 'json',
                        writeAllFields: true,
                        allowSingle: false,
                        root: 'data'
                }
    
        },
        
        constructor: function( aConfig ) {
             this.initConfig();
             this.callParent(arguments);
        
        }
    });

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,488
    Answers
    74

    Default

    Sounds like there is a requires statement missing. If you include Ext.grid.* in your application requires does it work?
    Aaron Conran
    @aconran

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
  •