标签:高级 text add gui put from prevent dal function
方法一:
p1_dialog_seniorSearch.dialog({ title:"高级查询", autoOpen:false,//默认关闭 modal: true,//开启遮罩层 width:570, height:330, buttons: { "查询":function(){ seniorSearch(1,20) } , "关闭": function() { p1_dialog_seniorSearch.dialog( "close" ); } }, open:function(event, ui){ $(this).parent().focus(); }//取消获取焦点 });
方法二:
在要焦点的的控件加上 autofocus
如:第一个控件为 datepicker,默认dialog打开会自动弹出日历
解决:在该dialog加个隐藏input,
<input type="hidden" autofocus/>
未加 autofocus,dialog不会聚焦影藏的input的。
参考文章:
http://jqueryui.com/upgrade-guide/1.10/#added-ability-to-specify-which-element-to-focus-on-open
http://stackoverflow.com/questions/1202079/prevent-jquery-ui-dialog-from-setting-focus-to-first-textbox
标签:高级 text add gui put from prevent dal function
原文地址:http://www.cnblogs.com/dscms/p/6094807.html