Forum


20:36

20/08/2011

Hi all,
It appears that the "afterShowForm" event for View & Search in "navGrid" section is not supported. Is this correct?
I ask because i currently use jQuery's ".position" utility to keep jqGrid forms centered in the browser window on load and when the browser window is resized. It works great in the "afterShowForm" event functions for edit, add, and delete forms in the "navGrid" section, but not for view or search.
The following "afterShowForm" events initially position the jqGrid form in the center of the browser window but the view and search "afterShowForm" event appear not to work:
var wko1EditEventASF = function(formid) {
var grid = formid.selector.replace('FrmGrid_','editmod');
$('#editmod'+grid).position({my:'center', at:'center', of:window, collision: 'fit'});
}
var wko1DelEventASF = function(formid) {
var grid = formid.selector.replace('DelTbl_','delmod');
$('#delmod'+grid).position({my:'center', at:'center', of:window, collision: 'fit'});
}
var wko1ViewEventASF = function(formid) {
var grid = formid.selector.replace('ViewGrid_','viewmod');
$('#viewmod'+grid).position({my:'center', at:'center', of:window, collision: 'fit'});
}
var wko1SearchEventASF = function(formid) {
var grid = formid.selector.replace('fbox_','searchmodfbox_');
$('#searchmodfbox_'+grid).position({my:'center', at:'center', of:window, collision: 'fit'});
}
The following code keeps the position of the jqGrid forms (when one is called for) in the center of the browser window when browser window is resized – all work:
$(function() {
$(window).resize(function(event){
var grid = id of grid.
$('#editmod'+grid ).position({my:'center', at:'center', of:window, collision: 'fit'});
$('#delmod'+grid ).position({my:'center', at:'center', of:window, collision: 'fit'});
$('#viewmod'+grid ).position({my:'center', at:'center', of:window, collision: 'fit'});
$('#searchmodfbox_'+grid ).position({my:'center', at:'center', of:window, collision: 'fit'});
});
});
So, it would be nice to be able to trigger the "afterShowForm" event for View & Search in "navGrid" section.
Thanks.
Most Users Ever Online: 715
Currently Online:
47 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