Forum


22:30

28/08/2008

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},
...
03:37

Moderators
30/10/2007

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.
20:13

28/08/2008

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:01

Moderators
30/10/2007

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.
13:59

28/08/2008

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>
...
...
14:33

Moderators
30/10/2007

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.
15:39

28/08/2008

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.
15:39

28/08/2008

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.
Most Users Ever Online: 715
Currently Online:
81 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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66