I'm new to both jQuery and jqGrid, so I'm still finding my way. I've gotten jqGrid wo work successfully with regard to editing, deleting, data, etc. I want to execute a function everytime the "Reload" icon is clicked in the grid navigator. I tried adding the nec. code in the navigator (see below), but the code isn't getting executed. I'm sure I'm missing something obvious. Can anyone help?
// manage grid navigator buttons
var resp;
$("#CurrMoTime").navGrid("#pagerCurrMo",
// Navigator options
{edit:false,
add:false,
del:true,
search:false,
refresh:true},
// Edit Options
{},
// Add Options
{},
// Delete Options
{// The beforeShowForm property below changes the msg on the delete dialog box that appears
// when the assoc clicks on the trash can
beforeShowForm:
function ($form) {
$("td.delmsg").html("Delete selected row of Time Detail?");
},
onclickSubmit:
function(id) {
// Note: rowSeqNum – obtained by onSelectRow event in jqGrid def above (can't use getCell in Edit mode as per doc)
// delData – addt'l data sent to identify time detail to delete in ep_associate_time
// url – delete cfc/method to call to delete time detail
// aftersubmit – examine response returned by ajax call to delete time detail
jQuery('#CurrMoTime').delGridRow(id,
{delData: {seqnum:rowSeqNum},
url:'/cfapp/intranet/apps/rd/cf_components/Time.cfc?method=DelTime&UserId=' + varNulls + '&Password=' + varNulls + '&AssocEmplid=' + AssocEmplid + '&PED=' + CurrMoPED + '&callingpgm=' + PgmId,
afterSubmit:
function(response,postdata) {
if (response.status == 200) {
$("#delhdCurrMoTime span.ui-icon-closethick").trigger("click");
updateTotLogged(); // Update the Total Logged Percentage in Time Grid Header
cfrmTDTitle = "Delete Request Successful";
cfrmTDContent = "Your request to delete Time Detail has been successfully processed.";
DispTimedMsg(cfrmTDTitle,cfrmTDContent);
return true;
} else {
cfrmTDTitle = "";
cfrmTDContent = "";
DispTimedMsg(cfrmTDTitle,cfrmTDContent);
return false;
};
},
errorTextFormat:
function (response) {
// the selectors referenced below pertain to the title and body content of the Delete Dialog box; we are
// overriding them on error response returned from the server
$("span.ui-jqdialog-title").html("Delete Failed!");
$("#DelError td.ui-state-error").html("Contact ITAC if this problem persists!<br/><br/>Details: Pgm ID " + PgmId + "; CFC.Method – Time.DelTime; Period End Date – " + CurrMoPED + "; Associate ID – " + AssocEmplid + "; Time Detail Sequence # – " + rowSeqNum + ". Could not delete this row of time detail. HTTP Response Status – " + response.status + ".");
}
}
);
}
},
// Refresh Options
{afterRefresh:
function() {
window.alert("Got here!!!");
updateTotLogged(); // Update the Total Logged Percentage in Time Grid Header
}
}
);