Ext.form.FormPanel 无法显示表单面板求解答

<script type="text/javascript">

function Read1() {
        Ext.QuickTips.init();
        var MyForm=new Ext.form.FormPanel({
            title:'表单应用',
            width:300,
            height:200,
            frame:true,
            labelSeparator:':',
            labelAlign:'right',
            renderTo:id1,
            items:[
                new Ext.form.TextField({
                    fieldLabel:'用户名称',
                    allowBlank:false,
                    blankText:'请输入用户名',
                    msgTarget:'side'
                }),
                new Ext.form.TextField({
                    fieldLabel:'用户密码',
                    allowBlank:false,
                    inputType:'password',
                    blankText:'请输入密码',
                    msgTarget:'side'
                    
                })
            ]
        });
    }
    Ext.onReady(Read1);
    </script>

上面的代码  无法显示表单面板求解答


小怪兽爱吃肉
浏览 641回答 2
2回答

aluckdog

renderTo:id1这个id1对象从哪来的?如果是id,要用字符串,加引号

PIPIONE

renderTo:id1换成applyTo: 'id1'
打开App,查看更多内容
随时随地看视频慕课网APP