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
form edit editgridrow editdata empty
15/08/2011
22:01
Avatar
violinssoundcool
Member
Members
Forum Posts: 35
Member Since:
05/02/2009
sp_UserOfflineSmall Offline

I'm using form edit and editData to pass additioinal POST parameters to the server. However, the parameters are not being passed. When the code is loaded, the php variable $srn has a single digit number as its value. Here is my code:

            // Add Items
            $('#addItemButton').click(function(){
                $('#itemsGrid').jqGrid('editGridRow','new',{
                    editData:{
                        srn:'<?php echo $srn; ?>'
                    },    
                    height:190,
                    width:300,
                    zIndex:1005,
                    reloadAfterSubmit:false,
                    addCaption:"Add Item",
                    modal:true,
                    closeAfterAdd:true,
                    recreateForm:true,
                    beforeShowForm: function(id) {  //Hide Key Field(s)
                        $('#tr_id', id).hide();
                        $('#itemNo').autocomplete({
                            source: "ITEMS_AUTOCOMPLETE.php",
                            minLength: 1
                        });
                    },
                    afterSubmit:function(response,postdata){
                        $.getJSON("GET_JOBNO.php",{srn:'<?php echo $srn; ?>'},function(c){
                            var jobNo = c[0].jobNum;                    
                            $('#jobNo').val(jobNo);
                        });
                                
                        $('#itemsGrid').setColProp('pn',{editable:false});
                        $('#itemGrid').setColProp('d',{editable:false});
                        $('#itemGrid').setColProp('on',{editable:false});

                        $('#itemsGrid').setGridParam({
                            postData:{
                                jobNo:$('#jobNo').val(),
                                srn:'<?php echo $srn; ?>'
                            }
                        });
                        $('#itemsGrid').trigger("reloadGrid");
                    }
                });
            });

Anyone have an idea why srn is not being included as a POST parameter?

16/08/2011
18:05
Avatar
violinssoundcool
Member
Members
Forum Posts: 35
Member Since:
05/02/2009
sp_UserOfflineSmall Offline

I could still use some help on this, but a temporary fix is to add the following:

serializeEditData:function(postData){
     postData.srn = '<?php echo $srn; ?>';
     return postData;

}

While this works, I don't think it's really what serializeEditData is for.

12/09/2011
00:47
Avatar
nelsonm
Michigan, USA
Member
Members
Forum Posts: 106
Member Since:
20/08/2011
sp_UserOfflineSmall Offline
Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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