`
mickey_hou
  • 浏览: 238349 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

button

    博客分类:
  • ext
阅读更多
method one:

Ext.onReady(function(){
Ext.create('Ext.Button', {
    text: "CLICK",
    renderTo: Ext.get("login")/getBody(), //设置显示区域
    scale   : 'large', //设置按钮大小
    handler: function() {
             var form = this.up('form').getForm();//获取表单对象
//var field=form.findField("cloudSubsriberId");//表单取值“id:'cloudSubsriberId'”
   //var value=field.getValue();
                form.submit({
                    clientValidation:true,//进行客户端验证
                  waitMsg:'Registering......',
                  waitTitle:'Registering',
                  url:'cloudUser!register.action',
                  method:'POST',
                  success:function(form,action){
                  if (action.result.success == '1') {
                          document.location='login.jsp';
                        }else{
                          document.location='register.jsp';
                        }
                  },
                  failure:function(form,action){
                     Ext.Msg.alert('Registering','Register fial');
                  }
                  });
    }
});
})



method two:


Ext.onReady(function(){
Ext.create('Ext.Button', {
    text    : 'Dynamic Handler Button',
    renderTo: Ext.get("login"),
    handler : function() {
        // this button will spit out a different number every time you click it.
        // so firstly we must check if that number is already set:
        if (this.clickCount) {
            // looks like the property is already set, so lets just add 1 to that number and alert the user
            this.clickCount++;
            alert('You have clicked the button "' + this.clickCount + '" times.\n\nTry clicking it again..');
        } else {
            // if the clickCount property is not set, we will set it and alert the user
            this.clickCount = 1;
            alert('You just clicked the button for the first time!\n\nTry pressing it again..');
        }
    }
});
})



method three:


Ext.onReady(function(){
Ext.create('Ext.Button', {
    text: "CLICK",
    renderTo: Ext.get("login"),
    scale   : 'large',
    enableToggle: true,
    arrowAlign: 'bottom',
    menu      : [
{text: 'Item 1'},
{text: 'Item 2'},
{text: 'Item 3'},
{text: 'Item 4'}
    ],
    handler: function() {
//alert('You clicked the button!')
    }
});
})





method foure:


Ext.onReady(function(){
Ext.create('Ext.Button', {
    text     : 'Button',
    renderTo : Ext.getBody(),
    listeners: {
        click: function() {
            // this == the button, as we are in the local scope
            this.setText('I was clicked!');
        },
        mouseover: function() {
            // set a new config which says we moused over, if not already set
            if (!this.mousedOver) {
                this.mousedOver = true;
                alert('You moused over a button!\n\nI wont do this again.');
            }
        }
    }
});
})
分享到:
评论

相关推荐

    微信小程序 button样式设置为图片的方法

    下面通过多种方法给大家介绍微信小程序 button 的样式设置为图片,具体内容如下所示: 方法一:button 与 image 重叠 将button设为 opacity:0 然后定位放在那副图片的上边。 方法二:background-image background-...

    超炫button按钮动画效果

    超炫button按钮动画效果 附带activity切换动画效果,其实在一个项目里,大家自己体验吧!

    点击Button,对button进行旋转

    对button的旋转,点击button,然后button开始旋转

    探寻C# Button双击事件

    C# Button双击事件大家一定相当熟悉了,本文笔者又再一次为你阐述了C# Button双击事件的原理及实现 方法。 C# Button是有DoubleClick事件的,只是它没有出现在事件列表中,而且.net也是把这个事件给"屏蔽" 掉了...

    JavaScript在form表单中使用button按钮实现submit提交方法

    submit是button的一个特例,也是button的一种,它把提交这个动作自动集成了,submit和button,二者都以按钮的形式展现,看起来都是按钮,所不同的是type属性和处发响应的事件上。 在javaScript中关于submit和button的...

    透明Button 透明Button

    透明Button 透明Button 透明Button 透明Button 透明Button 透明Button

    cocos2d实现button(按钮)效果

    如slider(滑块),button(按钮),RollNumber(数字滚动),Progress(进度条)....控件一一在我的博客里面公布,可以直接使用.源码打包下载 开发人员:Jason's.Alex QQ:531401335 csdn博客:http://blog.csdn.net/RuShrooM

    QML的Button自定义样式

    在QML中用ButtonStyle来自定义Button的样式,用到了states属性

    好看的button样式

    分享50个CSS超炫丽button样式代码下载分享50个CSS超炫丽button样式代码下载

    微信小程序:button组件的边框设置

    button的边框是用:after方式实现的,用户如果在button上定义边框会出现两条线,需用:after的方式去覆盖默认值。如果设置了Button的背景色,没有用:after设置边框的颜色,则button的四个角会出现模糊的尖角。如下图所...

    android中listView的Button监听

    最近在做android项目时 发现要在listView用到Button等各种点击事件 经过各种百度 发现有两个简单的方法实现 我把demo放上去 为了方便自己以后用到 也方便学习listview实现button监听的同学们 注意 我用最新sdk...

    android 自定义各种风格button

    android 自定义各种风格button

    button的js代码

    new ButtonPanel( 'Text Only', [{ text: 'Add User' },{ text: 'Add User', scale: 'medium' },{ text: 'Add User', scale: 'large' }] ); new ButtonPanel( 'Icon Only', [{ iconCls: 'add16' }...

    wpf的button样式

    设置button的样式,内外发光,移动、点击、离开时产生不同的效果

    Button按钮的样式

    button的一些样式,改变button,使之变的生动。

    button按钮的四种监听及实例

    Button btn=(Button)findViewById(R.id.button1); btn.setOnClickListener(this); } 再创建方法   public void onClick(View v) { // TODO 自动生成的方法存根 Log.i("tag", "点击了button按钮"); } 实现...

    button_st.rar_Button_ST_STButton_button_button st_mfc button

    各种风格的VC BUTTON,对mfc button进行封装

    button自适应高度和自动换行

    button自适应高度和自动换行

    openLayers修改button图标样式

    1. 在做gis的时候经常会用到button按钮或者openLayers中的面板组件,为了页面的美化和人性化,我们不得不改变它本身自带的默认的图标,那东东不能直观的告诉用户它是干什么的,所以我们必须的做一些改变。

    好看的button样式CSS

    好看的button样式CSS,你值得下载,

Global site tag (gtag.js) - Google Analytics