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
to get Server answer
06/09/2008
22:30
Avatar
fxl
Member
Members
Forum Posts: 11
Member Since:
28/08/2008
sp_UserOfflineSmall Offline

Hi Tony.

I am using your Navigator program to study your great Jqgrid but I don't know how to get the server answer to verify if the changes was successfull.

Could you help me with a sample ?

Regards,

Fernando X

... 

editurl:"someurl.php",  // <-------------------- How to get the return ?

...

navGrid('#pagernav',

 {true,true,true,false},

{height:280,reloadAfterSubmit:true},

...

08/09/2008
03:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Use afterSubmit event for this purpose.

See docs

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.

09/09/2008
20:13
Avatar
fxl
Member
Members
Forum Posts: 11
Member Since:
28/08/2008
sp_UserOfflineSmall Offline

Thanks for your answer.

I used afterSubmit but the result was not exactly that I want.

 I don't understand how to get the server answer.

.navGrid('#pager2',
        {edit:true,add:true,del:true,refresh:false,search:false},
        {height:280,reloadAfterSubmit:false,top:20,left:30, closeAfterEdit:true, afterSubmit:function(server_status){                                                          if (server_status==0){alert("ok")}else{alert("error - server code return="+server_status)}; return[true];}}....

Please, help me.

Regards,
Fernando

10/09/2008
10:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello

Server ansver is already here

afterSubmit:function(server_status,aPostdata)

where server_status is the data returned from that server.

You should analyze it do something depending on it.

What is the data from server you should known

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.

10/09/2008
13:59
Avatar
fxl
Member
Members
Forum Posts: 11
Member Since:
28/08/2008
sp_UserOfflineSmall Offline

Tony

Sorry for disturb you but probably my script has a litte bug because the command alert(server_status+" xxx "+aPostdata) return the value [object XMLHttpRequest]  xxx [object Object]. I hopped the aPostdata got the value (rc=1,message='error - not update') from test.php Server.

Please, see the code below.

Regards,
Fernando

<script src=jquery.js"..."jquery.jqGrid.js"...js/jqDnR.js"...js/jqModal.js ...>  

jQuery(document).ready(function(){
jQuery("#list2").jqGrid({

url:'carga_tabela.php?nd='+new Date().getTime(),
    datatype: "json", colNames:['Cod.Contabil', ...... ,'Total','Notes'],

    colModel:[
        {name:'id',index:'id', width:55,editable:false,editoptions:{readonly:true,size:10}},
        {name:'cod_cont',index:'cod_cont', align:"left",width:80,editable:true,editoptions:{size:11}},
       {name:'nome',index:'nome', width:60, align:"left",editable:true,editoptions:{size:60}},
        {name:'cod_red',index:'cod_red', width:5, align:"right",editable:true,editoptions:{size:10}},...

...

...

      {name:'grupo',index:'grupo', width:5, sortable:true,editable:true,edittype:"text", editoptions:{rows:"2",cols:"20"}}

    ],
    rowNum:10, rowList:[10,20,30], pager: jQuery('#pager2'),
    sortname: 'id',viewrecords: true, sortorder: "asc",igpath:patch/images",
  loadonce: true, recordtext: 'registros',width:400,  pgbuttons: false,
  pgtext: "---",  caption: "Demo",
  editurl:"test.php"

}).navGrid('#pager2',edit:true,add:false,del:true,refresh:false,search:false},

{closeAfterEdit:true, afterSubmit:function(status,aPostdata)
                            { alert(status+" "+aPostdata);  return[true];}

},

{},..........

</script> 
</head>
<body>
<table id="list2" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager2" class="scroll" style="text-align:center;"></div>

...

...

10/09/2008
14:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

You should understand what is here.

1. status in your case is the data returned from the server. Typically thas can be xml, json,text and etc. To get the contents from server you should

analyze something like this status.responseText 

2. aPostdata in your case is the array (from the form) that is posted

to the server.

So my question is what  do you return from server as data?

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.

10/09/2008
15:39
Avatar
fxl
Member
Members
Forum Posts: 11
Member Since:
28/08/2008
sp_UserOfflineSmall Offline

LaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughing

My problem was only a simple detail.

I didn't know the responseText property. The program was ok all the time.  I did not only obtain the data to see the results.

I have a Java Server application. This return is visible now.

I need to test if the server is on-line, if the register is locket, etc.

Thanks a lot.

10/09/2008
15:39
Avatar
fxl
Member
Members
Forum Posts: 11
Member Since:
28/08/2008
sp_UserOfflineSmall Offline

LaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughingLaughing

My problem was only a simple detail.

I didn't know the responseText property. The program was ok all the time.  I did not only obtain the data to see the results.

I have a Java Server application. This return is visible now.

I need to test if the server is on-line, if the register is locket, etc.

Thanks a lot.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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