首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

ExtJS4.1点染不到界面上

2013-11-21 
ExtJS4.1渲染不到界面上今天看到别人的一段ExtJS代码,仿照着写了一下,但是没有显示出来,请高人指点一下分

ExtJS4.1渲染不到界面上
今天看到别人的一段ExtJS代码,仿照着写了一下,但是没有显示出来,请高人指点一下
分为3个文件,两个js,一个页面文件
bottom.js 页脚文件


Ext.define('App.Panels.BottomPanel',{
extend:'Ext.Panel',
constructor: function (config) {
        config = config || {};
        var op = {
            id: 'bottomPanel',
            region: 'south',
            title: '',
            header: false,
            floatable: false,
            border: false
        };
        Ext.apply(config, op);
        this.callParent([config]);
},
    initComponent: function () {
        var me = this;
        var toolbar = Ext.create('Ext.panel.Panel', {
            border: false,
            layout: 'hbox',
            width: '100%',
            height: 30,
            items: [{ xtype: 'tbspacer',
                width: 40
            }, {
                xtype: 'displayfield',
                width: 100,
                fieldStyle: {
                    color: '#dcefff'
                }
            },{
                xtype: 'displayfield',
                fieldStyle: {
                    color: '#dcefff'
                }
            },{ xtype: 'tbspacer',
                width: 50
            }, { xtype: 'tbfill' }, {
                xtype: 'displayfield',
                width: 400
            }]
        });
        me.items = [toolbar];
        me.callParent();
    }
});

Main.js主页面

Ext.define('App.Panels.MainView', {
    extend: 'Ext.Panel',
    constructor: function (config) {
        config = config || {};
        var op = {
            id: 'mainView',
            width: '100%',
            height: '100%',
            style: {
                minHeight: '660px'
            },
            renderTo: document.body,
            layout: 'border',
            border: false
        };
        Ext.apply(config, op);
        this.callParent([config]);
    },
    initComponent: function () {
        var me = this;


        this.items = [
                        Ext.create('App.Panels.BottomPanel')
                    ];
        Ext.create("Ext.form.Panel");//有这个就可以弹出对话框
        me.callParent();
    }
});


现在上面的代码渲染不到页面上,我看ExtJS的例子里思路差不多,请问错在哪里了
[解决办法]
你都没有创建对象怎么生成?

    Ext.onReady(function () {
        Ext.create('App.Panels.MainView', {renderTo:document.body})
    });

热点排行
Bad Request.