範例程式如下:
$(document).ready(function () {
$("input", "#querydataGridView").each(function () {
$(this).live('keypress', function (e) {
var p = e.which;
if (p == 13) {
var where = $("#dataGridView").datagrid('getWhere');
$("#dataGridView").datagrid('setWhere', where);
$("#querydataGridView").window('close'); //查詢視窗關閉
}
});
});