This example demonstartes new methods for posing data using postData array (thanks to Paul Tiseo).
If you have FireBug Installed you can see what data is posted.
Request:


Set Post Data
Get Post Data
Append Post Data
Set Post Data Item
Get Post Data Item
Remove Post Data Item

HTML ... <b>Request: </b> <span id="postdata"></span> <br/> <br/> <table id="pdata" class="scroll" cellpadding="0" cellspacing="0"></table> <div id="ppdata" class="scroll" style="text-align:center;"></div> <br /> <a href="javascript:void(0)" id="ps1">Set Post Data</a> <br /> <a href="javascript:void(0)" id="ps2">Get Post Data</a> <br /> <a href="javascript:void(0)" id="ps3" >Append Post Data</a> <br /> <a href="javascript:void(0)" id="ps4" >Set Post Data Item</a> <br /> <a href="javascript:void(0)" id="ps5" >Get Post Data Item</a> <br /> <a href="javascript:void(0)" id="ps6" >Remove Post Data Item</a> <script src="postdata.js" type="text/javascript"> </script> Java Scrpt code ... jQuery("#pdata").jqGrid({ url:'server.php', datatype: "xml", colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id',index:'id', width:55}, {name:'invdate',index:'invdate', width:90}, {name:'name',index:'name', width:100}, {name:'amount',index:'amount', width:80, align:"right"}, {name:'tax',index:'tax', width:80, align:"right"}, {name:'total',index:'total', width:80,align:"right"}, {name:'note',index:'note', width:150, sortable:false} ], rowNum:10, rowList:[10,20,30], imgpath: gridimgpath, pager: jQuery('#ppdata'), sortname: 'id', mtype: "POST", postData:{q:1}, viewrecords: true, sortorder: "desc", caption:"New Methods", multiselect: true }).navGrid('#ppdata',{edit:false,add:false,del:false}); jQuery("#ps1").click( function() { $("#pdata").setPostData({q:1,param1:"p1"}); $("#pdata").trigger("reloadGrid"); }); jQuery("#ps2").click( function() { var pd =$("#pdata").getPostData(); var r =""; $.each(pd,function(i){ r += i+": "+pd[i]+","; }) $("#postdata").html(r).css("background-color","yellow"); }); jQuery("#ps3").click( function() { $("#pdata").appendPostData({param2:"p2"}); $("#pdata").trigger("reloadGrid"); var pd =$("#pdata").getPostData(); var r =""; $.each(pd,function(i){ r += i+": "+pd[i]+","; }) $("#postdata").html(r).css("background-color","yellow"); }); jQuery("#ps4").click( function() { $("#pdata").setPostDataItem("param2","I'w new value"); $("#pdata").trigger("reloadGrid"); var pd =$("#pdata").getPostData(); var r =""; $.each(pd,function(i){ r += i+": "+pd[i]+","; }) $("#postdata").html(r).css("background-color","yellow"); }); jQuery("#ps5").click( function() { alert( "rows : "+$("#pdata").getPostDataItem("rows")); }); jQuery("#ps6").click( function() { $("#pdata").removePostDataItem("param1"); $("#pdata").trigger("reloadGrid"); var pd =$("#pdata").getPostData(); var r =""; $.each(pd,function(i){ r += i+": "+pd[i]+","; }) $("#postdata").html(r).css("background-color","yellow"); }); PHP with MySQL ... $page = $_GET['page']; // get the requested page $limit = $_GET['rows']; // get how many rows we want to have into the grid $sidx = $_GET['sidx']; // get index row - i.e. user click to sort $sord = $_GET['sord']; // get the direction if(!$sidx) $sidx =1; // connect to the database $db = mysql_connect($dbhost, $dbuser, $dbpassword) or die("Connection Error: " . mysql_error()); mysql_select_db($database) or die("Error conecting to db."); $result = mysql_query("SELECT COUNT(*) AS count FROM invheader a, clients b WHERE a.client_id=b.client_id"); $row = mysql_fetch_array($result,MYSQL_ASSOC); $count = $row['count']; if( $count >0 ) { $total_pages = ceil($count/$limit); } else { $total_pages = 0; } if ($page > $total_pages) $page=$total_pages; $start = $limit*$page - $limit; // do not put $limit*($page - 1) $SQL = "SELECT a.id, a.invdate, b.name, a.amount,a.tax,a.total,a.note FROM invheader a, clients b WHERE a.client_id=b.client_id ORDER BY $sidx $sord LIMIT $start , $limit"; $result = mysql_query( $SQL ) or die("Couldn’t execute query.".mysql_error()); if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) { header("Content-type: application/xhtml+xml;charset=utf-8"); } else { header("Content-type: text/xml;charset=utf-8"); } $et = ">"; echo "<?xml version='1.0' encoding='utf-8'?$et\n"; echo "<rows>"; echo "<page>".$page."</page>"; echo "<total>".$total_pages."</total>"; echo "<records>".$count."</records>"; // be sure to put text data in CDATA while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { echo "<row id='". $row[id]."'>"; echo "<cell>". $row[id]."</cell>"; echo "<cell>". $row[invdate]."</cell>"; echo "<cell><![CDATA[". $row[name]."]]></cell>"; echo "<cell>". $row[amount]."</cell>"; echo "<cell>". $row[tax]."</cell>"; echo "<cell>". $row[total]."</cell>"; echo "<cell><![CDATA[". $row[note]."]]></cell>"; echo "</row>"; } echo "</rows>"; ...