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
Strange problem
03/12/2011
18:25
Avatar
kazi
World
Member
Members
Forum Posts: 5
Member Since:
22/11/2011
sp_UserOfflineSmall Offline

I have validation function :

                jQuery("#grid").jqGrid('navGrid','#pager',{add:true,edit:true,del:false},

                {beforeSubmit:validatedata,closeAfterAdd: false,closeAfterEdit: false }                 );                                                           function validatedata( postdata,formid) { 

                                var message="11111111111111″;

                                var complete=false; 

                   $.ajaxSetup({ cache: false });

                     $.ajax({                           

                              type : 'POST',                           

                              url : 'd_eval.php',                           

                             dataType : 'json',                           

                             data: postdata,                           

                           success  : function(postdata) {                                 

                                         complete=false;                                 

                                        message=postdata.msg;                                 

                                        message='2222222222222';                                    }      

                                        });     

alert(message);     //  Strange !!!

                       return [complete,message] ;               

                      } 

IF i put alert before return , all is ok   (i can see message '2222222222222' on the top of edit form.  If there is no alert on the top is just first message  '11111111111111'      !        Is this a bug or i miss something? Confused

03/12/2011
19:36
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello kazi,

you should use async: false option of the $.ajax.

Best regards
Oleg 

03/12/2011
21:55
Avatar
kazi
World
Member
Members
Forum Posts: 5
Member Since:
22/11/2011
sp_UserOfflineSmall Offline

Hi OlegK !

Thank you !

05/12/2011
15:38
Avatar
kazi
World
Member
Members
Forum Posts: 5
Member Since:
22/11/2011
sp_UserOfflineSmall Offline

Hi again OlegK,

Can you help me little bit more ?  Because I want to know which  action is started from editing form , I tried   beforeCheckValues Event.   The documentation say that we have 3 parameters ( postdata,formid,mode) . When i use this event i receive just (postdata AND formid )   Parameter mode -miss.  The validation function is abs. the same (with 3 parameters) .

function validatedata( postdata,formid,mode)

07/12/2011
23:15
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hello,

I ocationally find your question because I don't subscribed the topic: one has on the stackoverflow more better notification system as here.

Abou your question I don't full understand your problem. How I can see from the fist look at the source code the documatation is correct and beforeCheckValues will be really called with 3 parameters. So if you don't receive the 3-d parameter you should post the code which you use. On the other side I don't understand why the 3-d parameter can be interesting bacause you can define separate parameters for Add and for Edit forms (see prmEdit and prmAdd parameters of navGrid).

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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