两个事情:
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>",
width: 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
转载于:https://www.cnblogs.com/simonhaninmelbourne/archive/2009/09/10/1563999.html