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
scope conflict - formedit / global var rp_ge
20/01/2011
10:48
Avatar
ludoo
Member
Members
Forum Posts: 5
Member Since:
03/01/2011
sp_UserOfflineSmall Offline

Hi , first great work ! Wonderful grid !

As mentionned in 3.8.2 changelog, "

  • jqGrid now should not have any dependency on other JS libs – we have only one name-space

But, in formedit (line 10) , variable rp_ge is global.

So when you use multiple grids, properties of rp_ge are mixed.

One miainbad effect is that events of last used grid fires on the other one.

Could you fix this by completely isolate this variable ?

Thanks

LudoO

20/01/2011
11:01
Avatar
ludoo
Member
Members
Forum Posts: 5
Member Since:
03/01/2011
sp_UserOfflineSmall Offline

As a workaround, it seems that removing global and set local var rp_ge works !

in grid.formedit.js

line 10

//var rp_ge = null;

line 342 in editGridRow :

var rp_ge = p; //rp_ge = p;

line 1475 in delGridRow  :

var rp_ge = p; //rp_ge = p;

20/01/2011
13:25
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello ludoo,

I disagree with you. The variable rp_ge defined in the line 10 is not global. It is define inside of the body of the function defined in the line 1. I recommend you to use http://www.jslint.com/ to verify JavaScript code. It shows which variables are global. The variable rp_ge defined in the line 10 is do not global.

Best regards
Oleg

20/01/2011
18:09
Avatar
ludoo
Member
Members
Forum Posts: 5
Member Since:
03/01/2011
sp_UserOfflineSmall Offline

Thanks for fast answer,

Oh yes, in compiled source, it is enclosed in correct scope (i looked in src code).

global is probably not the good term, but there is really a conflict with tihs variable.

This is my case :

the user edit a row in a grid A.

The edit form has a link to open another dialog box with a grid B.

grid B has edit capabilities too.

just open this last edit form.

Close edit form, close grid B box, 

then save grid A will fires beforeSubmit of grid B....

I think (but haven't test it) 2 grids with edit capabilities on the same page will cause the same bug.

Why my suggested solution seems to fix the problem ?

I spend a few times on debugging and going deep inside code but don't find exactly why there is a override.

Hope this will be useful enough for you to go deeper!

Best regards

LudoO

20/01/2011
20:00
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello,

I recommend you to try another setting of Add/Edit forms: recreateForm:true (see my feature request). Probably this simple setting will solve your problem.

Best regards
Oleg

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
41 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