So I found some good fixes for centering the confirm delete, edit, view etc dialog boxes here. However, when no rows are selected on the grid, a different dialog will appear that shows a simple "Warning: Please, select row." Besides this dialog having horrible grammar, I can't seem to find anyway of handling this dialog's events so that I can reposition as desired.
I added handlers for every event in the navGrid I could find and used BugZilla to see if it would stop on any of these events to no avail. When rows are selected, it will fire the delete event fine. Ideas? Below is my code:
$('#sessionGrid').jqGrid({...}).navGrid('#sessionPager', {
add: false,
edit: false,
del: true,
search: false,
closeOnEscape: true
}, {
afterShowForm: function (form) {
form.closest('div.ui-jqdialog').center();
}
}, {
afterShowForm: function (form) {
form.closest('div.ui-jqdialog').center();
}
}, {
caption: "Delete",
msg: "Delete the selected sessions?",
bSubmit: "Delete",
bCancel: "Cancel",
afterShowForm: function (form) {
form.closest('div.ui-jqdialog').center();
}
}, {
afterShowForm: function (form) {
form.closest('div.ui-jqdialog').center();
}
}, {
afterShowForm: function (form) {
form.closest('div.ui-jqdialog').center();
}
});