我已经为 jqGrid 的列之一绑定了 DatePicker 插件。我要做的就是在选择日期后刷新整个网格。下面的代码重新加载了网格,但它发出了一个简单的 GET 请求,没有任何搜索参数。如何解决?
$(function () {
$("#list").jqGrid({
url: '/Control/BookstoreInvoicesGridData/',
datatype: 'json',
mtype: 'GET',
colNames: ['Invoice #', 'Created', 'Customer ID', 'Total Amount', 'PaymentType'],
colModel: [
{ name: 'OrderID', index: 'OrderID', width: 20, align: 'center', sortable: true, search: true },
{ name: 'Created', index: 'Created', width: 40, align: 'center', sortable: true, search: true },
{ name: 'CustomerName', index: 'CustomerName', width: 60, align: 'center', sortable: true, search: true },
{ name: 'TotalAmount', index: 'TotalAmount', width: 40, align: 'center', sortable: true, search: false },
{ name: 'PaymentType', index: 'PaymentType', width: 40, align: 'center', sortable: true, search: false}],
pager: jQuery('#pager'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'OrderID',
sortorder: "desc",
viewrecords: true,
imgpath: '/scripts/themes/coffee/images',
width: '800'
});
$('#gs_Created').datepicker({
onSelect: function (dateText, inst) {
var e = $("#list").data("events");
if (typeof (e) !== "undefined" && typeof (e.reloadGrid) !== "undefined") {
$("#list").trigger("reloadGrid");
}
}
}
);
});