Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Bug in predefined action
09/08/2011
10:07
Avatar
NoiZy83
Member
Members
Forum Posts: 3
Member Since:
29/11/2010
sp_UserOfflineSmall Offline

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
09/08/2011
11:35
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

09/08/2011
12:09
Avatar
NoiZy83
Member
Members
Forum Posts: 3
Member Since:
29/11/2010
sp_UserOfflineSmall Offline

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

14/08/2011
10:53
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information