Possible Duplicate:
jqGrid Reposition Delete Confirmation Box
I've started using jqGrid for few days and everything is working cool.so far so good.
What borders me is that when you click on edit button in the NavGrid
without selecting a row, it shows a centered modal popup notifying of no row being selected.
But when you click on add or edit(with selected row) it shows a modal at the left side of the grid.Not centered at all.
I'll like to find a way to center it.
How is that done? or it can not be done out of the box?
thanks for reading this
For some reason Oleg's code, as listed, wasn't completely working for me (though I wouldn't have ever gotten this far without it).
Two issues:
1.) If you just paste in what's there, you'll move your edit modal, but not your add modal. I only have an add modal, so that was confusing for a while. You basically just double the code (see below).
2.) The code as written was adding the averaged top and left relative to the entire page rather than the parent div. I'm sure I'm missing something obvious (or perhaps that's what the TODO is about?), but this worked for me...
or just use
where gridId is your grid's ID, and then in css something like this:
}
cheers Jarek
It seems to me, that the easiest way to do this is to change the dialog position inside of the beforeShowForm event:
You can see live the example here.
Code below can used to center window. Oleg sample code is used for that.
If form height changes, it does not center. Testcase to reproduce form not centered issue.
Steps to reproduce:
Observerd:
view window is not centered, bottom content is not visible and not accessible.