zoukankan      html  css  js  c++  java
  • 学习ExtJS(二) Button常用方法

    一、属性
    renderTo:将当前对象所生成的HTML对象存放在指定的对象中
    text:得到按钮名称
    minWidth:按钮最小宽度
    hidden:按钮的隐藏或显示(true or false)

    二、构造参数
    handler:指定一个函数句柄,在默认事件触发时调用,此时在默认事件为click
    listeners:在对象初始化之前,将一系列事件进行绑定。

    三、函数
    getBogy():对到Body对象
    onReady():当页面加载完成时执行本函数
    getText():得到按钮名称
    setText("按钮名称"):设置按钮名称
     
    四、应用举例    
      Ext.onReady(function(){
       var button
    =  new Ext.Button({
                renderTo:Ext.getBody(),
                text:
    "确定",
                listeners:{
                
    "click":function()
                {
                   alert(
    "Hello");
                }
                }
                
                })
                
                button.minWidth
    =200;
                button.setText(
    "EasyPass");
      })
       

      Ext.onReady(function(){
       var button
    =  new Ext.Button({
                renderTo:Ext.getBody(),
                text:
    "确定"
                
                })
                button.on(
    "click",function(){
                  alert(
    "hello");
                  })
                  
                button.minWidth
    =200;
                button.setText(
    "EasyPass");
      })
      
  • 相关阅读:
    APP内跳转链接用INTENT,但是用系统浏览器,在内部还是要webview
    MNIST练习
    Trigger_word_detection_v1a
    Neural_machine_translation_with_attention_v4a
    Operations_on_word_vectors_v2a
    Improvise_a_Jazz_Solo_with_an_LSTM_Network_v3a-2
    Dinosaurus_Island_Character_level_language_model_final_v3b
    Building_a_Recurrent_Neural_Network_Step_by_Step_v3b
    Sequence model
    Face_Recognition_v3a
  • 原文地址:https://www.cnblogs.com/easypass/p/1572608.html
Copyright © 2011-2022 走看看