Forum
11:51
06/06/2011
Hi, I'm trying to configure the HTTP method CRUD operations. To do this, I've configured the navGrid:
$("#usersTable").jqGrid('navGrid', "#usersPager", {add : true,edit:true, del:true},
{/*edit options*/
mtype: "PUT"
}
{/*add options*/
mtype: "POST"
}
{/*del options*/
mtype: "DELETE"
}
);
"Del" works well, but Add and Edit seems to interfer because the first operation I perform, forces the http operation on the other.
For example:
After page loading, If I click "add", POST operation is performed, but after also for "edit" POST is used next times.
After page loading, If I click "edit", PUT operation is performed, but after also for "add" PUT is used next times.
Is there a way to configure these operations separately?
Thanks.
21:16
06/06/2011
Bugzee said:
The mtype is shared between both "add" and "edit" operations. I believe you'll need to request this as a feature or modify the code yourself….
The "editGridRow" function handles both add and edit operations. You might want to see the "grid.formedit.js"
Note: This is for form editing..
Ok, I think it is not completely correct share the same logic for add and edit, because there could be different behaviours, not only the HTTP operation type.
By the way, Is there a way to force the HTTP operation in the "beforeSubmit" event, respectively of add end edit options?
Thanks
21:51
Moderators
30/10/2007
Hello,
We will fix this very soon.
The behaviour is available since 4.1 and maybe we will go back to fix this error which is more important
Thank you.
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.
19:37
Moderators
30/10/2007
Hello,
I have fixed the problem (I hope)
https://github.com/tonytomov/jqGrid/commit/8cddf70ef3a34202ce0b92fb09a2e773fbb28255
Could you please try it and let me know of the result.
Thank you
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.
23:33
Moderators
30/10/2007
Hello,
How do you determine that it is not correct? (in FireFox it always say POST. You should determine this server side)
I have perform a lot of test and it works perfect.
Please note the following in jQuery documentation
typeString
The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.
as described here:
http://api.jquery.com/jQuery.ajax/
Regards
Tony
P.S. Are you using jqGrid PHP component here?
Also in order to test just replace PUT with GET in order to determine that it works correct!
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.
23:40
06/06/2011
Hi, this is the form editor fragment configuration:
I'm testing it with Firebugs, that shows the HTTP operation when the data is posted to the server. So, the operation is performed correctly but the first choice between add and edit force the HTTP operation for following invocations. For example, if the first operation is an "add", POST is performed. If I perform an "edit" without reloading the page, POST is performed instead of PUT. DELETE works correctly
Thanks.
$("#usersTable").jqGrid('navGrid', "#usersPager", {
add : true,edit:true,del:true,
search: false,
refresh: false,
view: false
},
{/*edit options*/
mtype: "PUT",
afterSubmit : function(response, postdata) {
if (response.responseText == "1") {
return [true,"",null]
} else {
return [false,response.responseText,null]
}
}
},
{/*add options*/
mtype: "POST",
afterSubmit : function(response, postdata) {
if (response.responseText == "1") {
return [true,"",null]
} else {
return [false,response.responseText,null]
}
}
},
{/*del options*/
mtype: "DELETE"
},
{/*search options*/ },
{/*view (details) options*/ }
}
);
00:09
Moderators
30/10/2007
Hello,
Thanks for your effort.
Just fond the problem. Will put a fix tommorow
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.
18:50
Moderators
30/10/2007
Hello,
As promised - here is the fix:
https://github.com/tonytomov/jqGrid/commit/f83c608b489d7f3bf483b7afbc524bd58265f337
Regards
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.
Most Users Ever Online: 715
Currently Online:
32 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