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
serializeEditData
19/01/2010
19:02
Avatar
CTAPbIu_MABP
Guest
Guests

I used jqgrid 3.6 for a while

and today i update it to 3.6.2 and find a bug

I  use custom serialization function (serializeEditData) becouse i use java as a back-end

something like this

    function serialize(data){
        if (!$.isEmptyObject(data.regions))
            data.regions = data.regions.split(",");
        if (!$.isEmptyObject(data.roles))
            data.roles = data.roles.split(",");
        var str = [];
        for(var i in data){
            if (i == "id" && data[i]=="_empty"){
                str.push("id=0");
            } else if (i == "oper"){
                // continue;
            } else if ($.isArray(data[i])){
                for (var j in data[i]){
                    str.push(i +"="+ data[i][j]);
                }
            } else {
                str.push(i +"="+ data[i]);
            }
        }
        return str.join("&");
    }

and i find that data.id wasnt passed to function when i add new row with form-editing

        grid.jqGrid("editGridRow", "new", {
            reloadAfterSubmit:false,
            closeAfterAdd:true,
            modal:true,
            url:url,
            addedrow : 'last',
            beforeSubmit : function(postdata){
            },
            afterSubmit : function(response){
            },
            serializeEditData : serialize
        });

plz look at this

22/01/2010
10:20
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks. Which version exactley do you use? I mean do you use the version from GitHub?

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

22/01/2010
14:55
Avatar
CTAPbIu_MABP
Guest
Guests

Yes. Im using latest version from GitHub.

24/01/2010
17:52
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Please use the 3.6.2, the version from GitHub is not stable.

There are some changes on this, but I'm not sure how to reslove these whitout to change some behaviour.

The main thing here is if we have in the grid column named id and this is the key column.

In case, if we want to insert the key 'id' in the db, this is overwritten by the edit form.

So I will try to prepare some things which will do our life easy - like configurable options for the id, oper and etc.

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

25/01/2010
12:42
Avatar
CTAPbIu_MABP
Guest
Guests

>> Please use the 3.6.2, the version from GitHub is not stable

Of course I understand this is not stable. But you also need somebody who will find your bugs)))

You can create some option for new id

        grid.jqGrid("editGridRow", "new", {
            reloadAfterSubmit:false,
            closeAfterAdd:true,
            modal:true,
            url:url,
            addedrow : 'last',
            addedid : 0  // <-- new option ["",0,null]
        });

26/01/2010
16:59
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks you very much. The old behaviour is again back. Also I have created more general solution for this.

http://github.com/tonytomov/jq.....261f3f468d

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

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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