解决方案 »

  1.   

    <div id="loginForm"></div>是不是要改为:
    <form id="loginForm"></form>??
      

  2.   

    我试了下还是不行,我想知道在Myeclipse用ext是不是还要下载什么东西吗??
      

  3.   

    js中的那个登陆界面,是动态生成的,当页面在浏览器中运行了才能显示的吧? html文件中是看不到内容的
      

  4.   

    Ext.onReady(function(){    var viewPort=new Ext.viewport({
                items[
                    new Ext.FormPanel({
            renderTo:"loginForm",
            id:"loginForm",
            title:"用户登录",
            width:300,
            heith:200,
            frame:true,
            floating:true,  //表示Panel是浮动
            items:[
                   new Ext.form.TextField({
                        fieldLabel:"用户名"
                    }),
                   new Ext.form.TextField({
                       fieldLabel:"密码",
                       inputType:"password"
                   })
                   ],
                   buttons:[
                            {text:"登录"},
                            {text:"重置"}
                            ]
        });
               ]
       });
        var loginFormx=(viewPort.getSize().width-loginForm.gerSize().width)/2;
        var loginFoemy=(viewPort.getSize().height-loginForm.gerSize().height)/2;
        loginForm.setPosition(loginFormx,loginFormy);
    });
      

  5.   

    把js引用写在你html的</body>之后