我有一个 id 为“go”的提交按钮,我通过它从服务器端检索数据,但由于数据长度很大,加载需要很长时间。因此,我想在 go 按钮单击时添加屏幕储物柜,但我不知道如何通过客户端的 jquery 来做到这一点..
请引导我到一个链接,我可以在其中获得 jquery 屏幕储物柜...
这是我的代码...
$(document).ready(function () {
$("#go").click(function (e) {
e.preventDefault();
$("#gridId").GridUnload();
gridload();
});
});
function gridload() {
$.ajax({
url: 'Default2.aspx/MyMethod?fromdate=' + $("#fromdate").val() + '&todate=' + $("#todate").val(),
dataType: 'json',
contentType: "application/json; charset=utf-8",
type: 'POST',
success: function (ReportDataNew, textStatus, XMLHttpRequest) {
//debugger;
gridData = JSON.parse(ReportDataNew.d);
//console.log(gridData);
//alert(gridData.length);
$("#gridId").jqGrid({
data: gridData,
datatype: "local",
height: '100%',
autowidth: true,
ignoreCase: true,
rowNum: 50,
rowList: [50, 100, 200],
colNames: ['UserName', 'Ordinal', 'Extension', 'Trunk', 'DialDate', 'DialTime', 'Duration', 'Destination', 'Price'],
colModel: [
{ name: 'username', index: 'username', width: 100, editable: true, sortable: true, align: 'center' },
{ name: 'ordinal', index: 'ordinal', width: 100, editable: true, sortable: true, align: 'center' },
{ name: 'extension', index: 'extension', editable: true, width: 100, sortable: true, align: 'center' },
{ name: 'trunk', index: 'trunk', width: 100, editable: true, sortable: true, align: 'center' },
{ name: 'dialdate', index: 'dialdate', editable: true, width: 100, sortable: true, align: 'center' },
{ name: 'dialtime', index: 'dialtime', editable: true, width: 100, sortable: true, align: 'center' },
{ name: 'duration', index: 'duration', editable: true, width: 100, sortable: true, align: 'center' },
{ name: 'destination', index: 'destination', editable: true, width: 100, sortable: true, align: 'center' },
{ name: 'price', index: 'price', width: 100, editable: true, sortable: true, align: 'center' }
],
pager: '#gridpager',
viewrecords: true,
toppager: true,
loadtext: 'Loading...'
});
任何帮助将不胜感激..提前谢谢..