Forum
10:07
29/11/2010
Hi,
I just want to report a bug with the predefined formatter "actions".
I need 1 day to find out that it have something to do with the formatter...
The situation is following.
I use one column with the formatter actions, and I use this peace of code:
jQuery('#list').jqGrid('navGrid', '#pager', { del: true, add: false, edit: false, search: false }, {}, {}, { afterShowForm: function (form) { var grid = jQuery('#list'); var dlgDiv = form.closest('div.ui-jqdialog'); var parentDiv = dlgDiv.parent(); var dlgWidth = dlgDiv.width(); var parentWidth = parentDiv.width(); var dlgHeight = dlgDiv.height(); var parentHeight = parentDiv.height(); var dialog = form.closest('div.ui-jqdialog'), selRowId = grid.jqGrid('getGridParam', 'selrow'), selRowCoordinates = $('#' + selRowId).offset(); selRowCoordinates["top"] = Math.round((parentHeight - dlgHeight) / 2) - 100; selRowCoordinates["left"] = Math.round((parentWidth - dlgWidth) / 2); dialog.offset(selRowCoordinates); } });
Which is by the way not perfect, because I have to subtract the 100px but thats not important.
Important is, this afterShowForm event is only fired if I cklick the delete button on the pager but not if I click the delete button in the predefined formatter column.
Which do both the same, excluding firing the event.
I hope you can fix it.
Best regards
11:35
Moderators
30/10/2007
Hello,
This is not a bug, but feature.
Options set in the toolbar does not have correlation with these set in formatter action.
In order to to set this create a variable object once and set it in the edit options and in formatter object.
See docs for this formatter:
http://www.trirand.com/jqgridw....._formatter
Regards
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.
12:09
29/11/2010
Hmm...I don't get it ;(
I tried this one:
colModel: [ {name:'aktion', index:'aktion', title: false, width:'40', align:'left', search: false, formatter: 'actions',
formatoptions:
{
editbutton: false,
delOptions: { afterShowForm: function (form) { var grid = jQuery('#listAnhangListe'); var dlgDiv = form.closest('div.ui-jqdialog'); var parentDiv = dlgDiv.parent(); var dlgWidth = dlgDiv.width(); var parentWidth = parentDiv.width(); var dlgHeight = dlgDiv.height(); var parentHeight = parentDiv.height(); var dialog = form.closest('div.ui-jqdialog'), selRowId = grid.jqGrid('getGridParam', 'selrow'), selRowCoordinates = $('#' + selRowId).offset(); selRowCoordinates['top'] = Math.round((parentHeight - dlgHeight) / 2) - 100; selRowCoordinates['left'] = Math.round((parentWidth - dlgWidth) / 2); dialog.offset(selRowCoordinates); } } }}, {name:'referenztyp', index:'referenztyp', title: false, align:'left', hidden: true}, {name:'referenzid1', index:'referenzid1', title: false, align:'left', hidden: true}, {name:'referenzid2', index:'referenzid2', title: false, align:'left', hidden: true},]
But it doesent work (It is the same code like in the pager) , my Google Chrome said that he can't set the property top of a null object!
Best regards
10:53
Moderators
30/10/2007
Hello,
Strange. Could you please try first with simple alerts instead of so complex code.
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: 715
Currently Online:
51 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