龙博3.0β源码SVN地址http://linb.googlecode.com/svn/trunk/jsLinb3.0
下载龙博3.0β源码包!    下载龙博3.0教程-入门篇 pdf 版!
返回列表 回复 发帖

登陆对话框

  1. Class('App.LogInDlg', 'linb.Com',{
  2.     Instance:{
  3.         iniComponents:function(){
  4.             // [[code created by jsLinb UI Builder
  5.             var host=this, children=[], append=function(child){children.push(child.get(0))};
  6.             
  7.             append((new linb.UI.Dialog)
  8.                 .host(host,"dlg")
  9.                 .setHeight(140)
  10.                 .setCaption("请登陆")
  11.                 .setMinBtn(false)
  12.                 .setMaxBtn(false)
  13.                 .setPinBtn(false)
  14.             );
  15.             
  16.             host.dlg.append((new linb.UI.Div)
  17.                 .host(host,"div8")
  18.                 .setLeft(41)
  19.                 .setTop(14)
  20.                 .setWidth(60)
  21.                 .setHeight(20)
  22.                 .setHtml("用户名")
  23.             );
  24.             
  25.             host.dlg.append((new linb.UI.Div)
  26.                 .host(host,"div9")
  27.                 .setLeft(50)
  28.                 .setTop(44)
  29.                 .setWidth(60)
  30.                 .setHeight(20)
  31.                 .setHtml("密 码")
  32.             );
  33.             
  34.             host.dlg.append((new linb.UI.Input)
  35.                 .host(host,"iUserName")
  36.                 .setLeft(101)
  37.                 .setTop(14)
  38.                 .setWidth(170)
  39.             );
  40.             
  41.             host.dlg.append((new linb.UI.Input)
  42.                 .host(host,"iPass")
  43.                 .setLeft(100)
  44.                 .setTop(44)
  45.                 .setWidth(170)
  46.                 .setType("password")
  47.             );
  48.             
  49.             host.dlg.append((new linb.UI.Button)
  50.                 .host(host,"btnLogin")
  51.                 .setLeft(191)
  52.                 .setTop(76)
  53.                 .setWidth(80)
  54.                 .setCaption("登 陆")
  55.                 .onClick("_btnlogin_onclick")
  56.             );
  57.             
  58.             host.dlg.append((new linb.UI.Button)
  59.                 .host(host,"btnCancel")
  60.                 .setLeft(101)
  61.                 .setTop(76)
  62.                 .setWidth(80)
  63.                 .setCaption("取 消")
  64.                 .onClick("_btncancel_onclick")
  65.             );
  66.             
  67.             return children;
  68.             // ]]code created by jsLinb UI Builder
  69.         },
  70.         _btncancel_onclick:function (profile, e, src, value) {
  71.             //本Com的取消事件
  72.             if(false!==_.tryF(this.beforeClose,[profile],this))
  73.                 this.dlg.close();
  74.         },
  75.         _btnlogin_onclick:function (profile, e, src, value) {
  76.             var user, pass;
  77.             if(!(user=this.iUserName.getUIValue())){
  78.                 linb.message('请输入用户名!')
  79.                 this.iUserName.activate();
  80.                 return;
  81.             }
  82.             if(!(pass=this.iPass.getUIValue())){
  83.                 linb.message('请输入密码!')
  84.                 this.iPass.activate();
  85.                 return;
  86.             }
  87.             //本Com的登陆事件
  88.             _.tryF(this.onLogIn,[user,pass],this);
  89.         }
  90.     }
  91. });
复制代码
附件: 您所在的用户组无法下载或查看附件
图片的外观,看起来也不错.
貌似 较多人用 “登录” 吧?   还是大家都用“登陆”嘎?
if(!(user=this.iUserName.getUIValue())){

                linb.message('请输入用户名!')

                this.iUserName.activate();

                return;

            }

            if(!(pass=this.iPass.getUIValue())){

                linb.message('请输入密码!')

                this.iPass.activate();

                return;

            }

老大,iUsername和ipass哪里来的??
哦,看到了,呵呵,不好意思!!
//本Com的登陆事件

            _.tryF(this.onLogIn,[user,pass],this);

这个方法如何和后台交互????
这只个回调函数。
和后台交互要用Ajax
尊重彼此感受,善待体验工具,时时不忘召唤自己。
返回列表