Forum
Topic RSS
10:46
20/03/2009
OfflineHi: Just another question in regards to loading forms with the a grid.
I've got the following:g.editGridRow(rowid,{top:0,left:0,height:450,width:450,reloadAfterSubmit:true,recreateForm:true,closeAfterEdit:true,modal:true, beforeSubmit:function(pdata){.....
where g is my grid.
I am trying to better understand the top and left parameters as my form never consistently loads in the same place. The position tends to be more of a relations of where the page is scrolled and not the top/left of the grid.
What I want is to consistently load any of the data entry forms at the same location on the page, with the top and left of the form always appearing at the top corner of the grid and running along it's left edge.
As per the docs:
| Property | Description | Default |
|---|---|---|
| top | the initial top position of modal dialog. The default value of 0 mean the top position from the upper left corner of the grid. When jqModal option is true (see below) and jqModal plugin is present any value different from 0 mean the top position from upper left corner of the window. | 0 |
| left | the initial left position of modal dialog. The default value of 0 mean the left position from the upper left corner of the grid. When jqModal option is true (see below) and jqModal plugin is present any value different from 0 mean the left position from upper left corner of the window. | 0 |
When I look below at jqModal/modal properties it just tells me whether or not it will use the modal.js file. If I change the top and left, ie
var ftop = $("#ProjectTabs").position().top + "px";
var fleft = $("#ProjectTabs").position().left + "px";
where #ProjectTabs is a jQuery UI tab interface. I was expecting the form to load at the top and left corner of the tab but it doesn't, it still loads elsewhere in the page and still seems to depend on the scrolled position.
Has anyone found a good way of setting the position for a modal form in a consistent position ?
Nathan
05:31
Moderators
30/10/2007
OfflineHello,
This is discused many times. The problem is that the modal have absolute position.
To solve this problem just set in the editGridRow the following option
recreateForm : true
This will recreate the form every time you click edit or add and place it at upper left corner of the grid.
Another solutuion is not to use jqModal - i.e set it to false
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 994
Currently Online:
15 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66
Log In
Home