日期:2014-05-16 浏览次数:20855 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css" /> <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="extjs/ext-all.js"></script> <script> Ext.onReady(function(){ oForm = new Ext.FormPanel({ renderTo:"form_panel", layout:"form", hideLabels:false, border:false, items:[ {fieldLabel:'性别',enableKeyEvents:true,id:'sel_gender',name:'sel_gender',xtype:'combo',store:[[0,'女'],[1,'男']],editable:false,hiddenName:'gender',forceSelection:true,mode:'local',triggerAction:'all',value:'1', listeners:{ keydown:function(obj, e){ if(e.getKey()==8){ alert("ok"); e.stopEvent(); return false; } } } } ] }); Ext.getCmp('sel_gender').focus(); }); </script> <div id="form_panel"></div>