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
support default values for $.jgrid.createModal
27/06/2012
19:30
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello Tony,

many jqGrid methods allow to set default values for parameters by extending some "default" objects (like $.jgrid.defaults, $.jgrid.search, $.jgrid.edit, $.jgrid.nav, $.jgrid.del, $.jgrid.view, $.jgrid.inlineEdit and so on). I personally find the way very practical. So I suggest to infroduce one more "default" object used by $.jgrid.createModal.

If one instert as the first line of the code of $.jgrid.createModal the following line

p = $.extend(true, {$.jgrid.createModal, p);

then one will be able for example to set some common options like zIndex or closeOnEscape. The current code of navGrid supports (but don't documents) the options alertzIndex (of closeOnEscape) for example, but all other calls of $.jgrid.createModal in grid.formedit.js don't have the possibility. Introduction of $.jgrid.createModal (I didn't found the better name) will be helpful for all cases of usage $.jgrid.createModal method.

Best regards
Oleg 

01/07/2012
13:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello Oleg,

I have done it llike this:

p = $.extend(true, $.jgrid.jqModal || {}, p)

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.

01/07/2012
13:54
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You are right Tony, the usage of $.jgrid.jqModal || {} is definitively better.

Regards
Olge 

01/09/2012
22:47
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Sorry Tony, but in both: my suggestion and your implementation there are bugs. The correct line of code should be

p = $.extend(true, {}, $.jgrid.jqModal || {}, p);

The currect code (see here)

p = $.extend(true, $.jgrid.jqModal || {}, p);

changes the value of $.jgrid.jqModal on every execution of createModal function with the value of p parameter. Moreover, the currect code of navGrid contains the definition of alertzIndex : null (see the line) which ovewrite the $.jgrid.jqModal.zIndex value.

I think that the line alertzIndex : null should be either removed or replaced with alertzIndex : undefined.

There are one more problem in the line

$.extend(mopt,modalopt || {});

of the method info_dialog and with the settings of properties like zIndex : 1000 at the beginning of the function (see the line). As the result the default value set at the beginging of info_dialog (like zIndex : 1000) will be forward to $.jgrid.createModal (see here) and will overwrite the default settings from $.jgrid.jqModal (see the first line of the createModal method).

As the result the $.jgrid.jqModal works currently only in some cases of the usage in form editing, but not works in other cases. For example in case of displaying of validation errors in inline editing the value zIndex : 1000 will be allways used.

It seems to me, that one can solve the problem by changing the line $.extend(mopt,modalopt || {}); of info_dialog to something like

$.extend(true, mopt, $.jgrid.jqModal || {}, {caption:"<b>"+caption+"</b>"},
    modalopt || {});

Additionally one should remove initializing of caption property of mopt (in the first line of the code).

I hope that all the changes will allows to set default setting (like zIndex) of jqGrid dialogs.

Best regards
Oleg

10/09/2012
19:28
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Thanks Oleg,

Fixed in GitHub.

Best 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:
28 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