- Class('App.LogInDlg', 'linb.Com',{
- Instance:{
- iniComponents:function(){
- // [[code created by jsLinb UI Builder
- var host=this, children=[], append=function(child){children.push(child.get(0))};
-
- append((new linb.UI.Dialog)
- .host(host,"dlg")
- .setHeight(140)
- .setCaption("请登陆")
- .setMinBtn(false)
- .setMaxBtn(false)
- .setPinBtn(false)
- );
-
- host.dlg.append((new linb.UI.Div)
- .host(host,"div8")
- .setLeft(41)
- .setTop(14)
- .setWidth(60)
- .setHeight(20)
- .setHtml("用户名")
- );
-
- host.dlg.append((new linb.UI.Div)
- .host(host,"div9")
- .setLeft(50)
- .setTop(44)
- .setWidth(60)
- .setHeight(20)
- .setHtml("密 码")
- );
-
- host.dlg.append((new linb.UI.Input)
- .host(host,"iUserName")
- .setLeft(101)
- .setTop(14)
- .setWidth(170)
- );
-
- host.dlg.append((new linb.UI.Input)
- .host(host,"iPass")
- .setLeft(100)
- .setTop(44)
- .setWidth(170)
- .setType("password")
- );
-
- host.dlg.append((new linb.UI.Button)
- .host(host,"btnLogin")
- .setLeft(191)
- .setTop(76)
- .setWidth(80)
- .setCaption("登 陆")
- .onClick("_btnlogin_onclick")
- );
-
- host.dlg.append((new linb.UI.Button)
- .host(host,"btnCancel")
- .setLeft(101)
- .setTop(76)
- .setWidth(80)
- .setCaption("取 消")
- .onClick("_btncancel_onclick")
- );
-
- return children;
- // ]]code created by jsLinb UI Builder
- },
- _btncancel_onclick:function (profile, e, src, value) {
- //本Com的取消事件
- if(false!==_.tryF(this.beforeClose,[profile],this))
- this.dlg.close();
- },
- _btnlogin_onclick:function (profile, e, src, value) {
- var user, pass;
- if(!(user=this.iUserName.getUIValue())){
- linb.message('请输入用户名!')
- this.iUserName.activate();
- return;
- }
- if(!(pass=this.iPass.getUIValue())){
- linb.message('请输入密码!')
- this.iPass.activate();
- return;
- }
- //本Com的登陆事件
- _.tryF(this.onLogIn,[user,pass],this);
- }
- }
- });
复制代码 |