在dilog的open事件中 添加如下代码段
复制代码 代码如下:
$(#dlgsearch).dialog({
autoopen: false,
bgiframe: true,
width: 600,
//height: 225,
modal: true,
resizable: false,
open: function() {
//jquery之dialog的键盘事件(输入完毕回车检索)
$(this).bind(keypress.ui-dialog, function(event) {
if (event.keycode == $.ui.keycode.enter) {
alert(enter pressed!);
}
});
},
buttons: {
取消: function() {
$(this).dialog(close);
},
搜索: function() {
}
},
close: function() {
}
});