is there a way to positioning the dialog message \"Please select row\" in the corner left top of the selected grid?
I just want the same behavior in alert warning, j
As I wrote upper in a comment I have a long table and I need alert window always to be at the center of viewport. So I need dynamic positioning of the alert window. I need to set position after user scroll page down and click "edit" or "delete".
As I understand Nav does not have events like "beforeShowForm" or "beforeShowSearch" for the alert modal window. Also I can't catch clicks on the pager.
Solution provided by Oleg and Paulo Pinto does not work for me. I don't know why. I even don't understand how it works :)
So I found my own straight and ... not nice way.
loadComplete: function(){
$(window).scroll(function() {
$('#alert_window_id').center();
});
}
where "center()" is
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
this.css("left", ( $(window).width() - this.width() ) / 2+$(window).scrollLeft() + "px");
return this;
}
After loadComplete the alert div seems already exist and grid has its full height so window scroll exists too. Because I have no events of clicking "edit" button or alert dialog shown - i am repositioning alert dialog after every scroll event.
look at this answer
http://www.ok-soft-gmbh.com/jqGrid/CenterEditForm.htm
you need to change your beforeShowForm event
or you can implement this function on afterShowform event
function centerForm ($form) {
$form.closest('div.ui-jqdialog').position({
my: "center",
of: $('#grid').closest('div.ui-jqgrid')
});
}
If I understand correct your question you can use alerttop
and alertleft
options of navGrid. The parameters could be included in parameters
option of navGrid
. The answer describes one more non-documented options of navGrid
.