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_Related Related Topics sp_TopicIcon
Possibile bug in "mtype" option inside add/edit options.
27/06/2011
11:51
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

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.

27/06/2011
18:28
Avatar
Bugzee
Member
Members
Forum Posts: 7
Member Since:
21/04/2011
sp_UserOfflineSmall Offline

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..

27/06/2011
21:16
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

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

27/06/2011
21:51
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

27/06/2011
21:59
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

tony said:

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


Thanks Tony!

30/06/2011
17:49
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

tony said:

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


One question: in mean time the bug is fixing, is there any workaround to get working this scenario in 4.1.1? Thanks

04/07/2011
19:37
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

04/07/2011
20:59
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

Hi, unfortunately it doesn't work. I verified with debugger that the lines you have changed are executed, the rp_ge object contains the correct "mtype" value after that, but at submit the wrong operation is performed.

Thanks.

04/07/2011
23:33
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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

Default: 'GET'

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?

http://www.trirand.net/

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.

04/07/2011
23:40
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

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*/ }
             }
        );

05/07/2011
00:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

05/07/2011
18:50
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

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.

05/07/2011
21:43
Avatar
r.cappa
Member
Members
Forum Posts: 25
Member Since:
06/06/2011
sp_UserOfflineSmall Offline

It's perfect! Thanks! Cool

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information