我使用jqGrid并且工作正常。我关心的是如何在提交内联编辑按钮时显示处理屏幕。
$(grid_selector).jqGrid({
datatype: "local",
height: "auto",
colNames: ['LeaveTypeId', 'EmployeeId', 'Leave Type', 'Leave Act', 'Carry Forward', ' ', 'Total', 'Approved', 'Pending', 'Total'],
colModel: [
{ name: 'LeaveTypeId', index: 'LeaveTypeId', hidden: true, editable: true },
{ name: 'EmployeeId', index: 'EmployeeId', hidden: true, editable: true },
{ name: 'LeaveType', index: 'LeaveType' },
{ name: 'LeaveActEntitlement', width: 120, index: 'LeaveActEntitlement', editrules: { custom: true, custom_func: validate_edit }, hidedlg: true, editable: true },
{ name: 'ForwardedEntitlement', width: 120, index: 'ForwardedEntitlement', editrules: { custom: true, custom_func: validate_edit }, hidedlg: true, editable: true },
{
name: 'myac',
index: 'LeaveActEntitlement',
width: 77,
fixed: true,
sortable: false,
resize: false,
formatter: 'actions',
formatoptions: {
delbutton: false,
editOptions: {
onclickSubmit: function (params, posdata) {
// function to show wait block
ShowWaitBlock();
},
},
onSuccess: function ( response) {
var jsonResponse = response.responseJSON;
if (showMessage(jsonResponse))
{
$(".tooltip").hide();
var data = $(grid_selector).jqGrid("getGridParam", "data");
data[selectedRowId - 1] = jsonResponse.data;
ReloadGrid(data);
}
// function to hide wait block
HideWaitblock();
},
}
},
{ name: 'TotalEntitlement', index: 'TotalEntitlement' },
{ name: 'Approved', index: 'Approved' },
{ name: 'Pending', index: 'Pending' },
{ name: 'TotalLeaveTransactions', index: 'TotalLeaveTransactions' }
],
viewrecords: true,
rowNum: 10,
rowList: [10, 20, 30],
ajaxRowOptions: {
beforeSend: function () {
alert("Editing");
// function to show processing screen
ShowWaitBlock();
}
},
//pager: pager_selector,
//altRows: true,
multiselect: true,
multiboxonly: false,
//loadtext:"Loading...",
loadComplete: function() {
var table = this;
setTimeout(function() {
updatePagerIcons(table);
enableTooltips(table);
}, 0);
$(".cbox").hide();
},
onSelectRow: function (id) {
if (id) {
selectedRowId = id; // save current row ID
$("#info_dialog").css('background-color', 'blue');
$("#info_dialog").css('display', 'none');
}
},
loadonce: false,
editurl: '/LeaveManagement/LeaveEntitlement/EditEntitlement' ,
autowidth: false,
width: 1119
}).trigger('reloadGrid');
onClickSubmit上的此警报触发。但它不显示等待屏幕。我的等待屏幕功能在应用程序的任何地方都能正常工作 我甚至试图在
中调用该函数$('.ui-icon-pencil').click(function(){
ShowWaitBlock();
});
即使这对我也没有用。
任何有用的帮助。