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
Getting data from a form (userData)
26/08/2009
08:24
Avatar
dsh0105
Member
Members
Forum Posts: 4
Member Since:
26/08/2009
sp_UserOfflineSmall Offline

I'm trying to send extra variables to the script that populates the grid. The information is stored in a form. From what I can tell, this is acomplished using userData. Indeed what I've got does submit the from field — but no the value.

I checked the javascript that pulls the form value. When used outside of the grid, it works used inside the gird it always posts null. Any help would be greatly appriciated.

Here's the client side code I'm working with. I've bolded the line in question.

jQuery(document).ready(function(){
  jQuery(”#list”).jqGrid({
    url:'poquery.php',   
    datatype: 'json',
    mtype: 'POST',
    colNames:['PO Number ','Date','Vendor','Dept','Buyer','Terms'],
    colModel :[
      {name:'PONUMB', index:'PONUMB', width:65},
      {name:'PODATE', index:'PODATE', width:70},
      {name:'POVEND', index:'POVEND', width:70},
      {name:'POIDPT', index:'POIDPT', width:70},
      {name:'POINIT', index:'POINIT', width:70},
      {name:'TERMS', index:'TERMS', width:70},

   
    ],
    postData: {POINIT : jQuery('#POINIT').val()},

    pager: '#pager',
    rowNum:10,
    rowList:[10,20,30],
    sortname: 'PONUMB',
    sortorder: 'desc',
    viewrecords: true,
    caption: 'Purchase orders'
  }).navGrid('#gridpager',{view:false,edit:false,add:false, del:false},
{}, // use default settings for edit
{}, // use default settings for add
{},  // delete instead that del:false we need this
{multipleSearch : true}, // enable the advanced searching
{closeOnEscape:true} /* allow the view dialog to be closed when user press ESC key*/
);

 });

Here is a snipet from the form showing where the value is defined.

            <td width=”47″><select name=”POINIT” id=”POINIT” multiple=”multiple”>
              <?php
            $buyers=getBuyerList();
            foreach ($buyers as $buyer)
                {
                $init=$buyer->BUYER;
                echo “<option value=\\”$init\\”>$init</option>”;
                }
            ?>
            </select></td>

Any help you can provide would be greatly appricated.

Edited to correct error. Function being used is postData -- not userData.

Thanks,

David Hamilton

27/08/2009
07:32
Avatar
Renso
PA
Member
Members
Forum Posts: 118
Member Since:
11/09/2008
sp_UserOfflineSmall Offline

If I understand/assume correctly, the POINIT is posted when retrieving the data when populating the grid, but not when editing or adding the data? "postData" property will not post it when editing, adding or deleting via the navGrid CRUD functions. For that you need to append it to the editUrl as in editUrl: myUrl + '?POINIT=' +$('#POINIT').val();

When you say it works outside of the grid, I am not sure how you or where you tested this, so try and do a console.log with Firebug or alert to show the value of POINIT just before the grid is defined, something like:

console.log($('#POINIT').val());

$('#list').jqGrid......

31/08/2009
05:24
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

or simply use the editData array.

See http://www.trirand.com/jqgridw.....ditgridrow

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