zoukankan      html  css  js  c++  java
  • ExtJS 弹出窗口Window设初始焦点

    两个事情:
    1. title 中可以使用HTML 动态设定字体等属性;
    2. "show" 事件中,Ext.getCmp("btnSale").focus('', 100); btnSale 为要设置焦点的元素的id 。

    CompleteWin = new Ext.Window({
            id: 'MyCompleteWin',
            title: "<span style='font-size:16px'><image src='images/my.ico'>My Window </span>",
            520,
            height: 490,
            plain: true,
            //iconCls: "addicon",
            minimizable: false,
            resizable: false,
            //defaultType: "textfield",
            labelWidth: 100,
            collapsible: false,
            closeAction: 'hide',
            closable: false,
            modal: 'true',
            //buttonAlign: "center",
            items: CompleteForm,
            listeners: {
                "show": function() {
                    CompleteForm.getForm().reset();
                    
                    Ext.getCmp("btnSale").focus('', 100);   //100 表示延时
              //或者: Ext.getCmp("btnSale").focus(false, 100);
              //   Ext.getCmp("btnSale").focus(true, 100);
                }
            }
    .....
    });

    如果设Window的默认按钮可以使用属性:  defaultButton
  • 相关阅读:
    PHP乘法表
    通过闭包可以返回局部变量
    FZU2125_简单的等式
    FZU2122_又见LKity
    FZU2121_神庙逃亡
    UVA12585_Poker End Games
    UVA12583_Memory Overow
    HDU4647_Another Graph Game
    HDU4646_Laser Beam
    HDU4787_GRE Words Revenge
  • 原文地址:https://www.cnblogs.com/simonhaninmelbourne/p/1563999.html
Copyright © 2011-2022 走看看