jQuery UI 对话框(Dialog) 添加确认按钮 回车事件

jQuery UI 对话框(Dialog) 添加确认按钮的回车事件

直接在toolbar事件中,添加open属性方法。

open: function () {$(this).bind("keypress.ui-dialog", function (event) {if (event.keyCode == $.ui.keyCode.ENTER) {$(".ui-dialog-buttonpane button").first().click();return false;}});},