<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Pager not working on Master</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Pager not working on Master</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master#p28158</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master#p28158</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>Please post your <a href="http://www.trirand.net/forum/default.aspx?g=forum" target="_blank">question here</a>.</p>
<p>Thank you</p>
</p>
<p>Kind Regards</p>
]]></description>
        	        	<pubDate>Tue, 29 Jan 2013 10:32:44 +0200</pubDate>
        </item>
        <item>
        	<title>sagana on Pager not working on Master</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master#p28154</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/pager-not-working-on-master#p28154</guid>
        	        	<description><![CDATA[<p>I have a Master/Detail situation. Everything works except the paging on the Master. It displays the first page but on clicking to go to the next or the end of the 17 pages , it reloads the first page again. If I remove any reference to the detail grid, the paging on the Master works.&#160; Any ideas please.</p>
<p>*******************************************************</p>
<p>Master</p>
<p>&#60;?php<br />session_start();<br />require("../db.php");</p>
<p>$coyidno = $_SESSION[&#39;s_coyid&#39;];</p>
<p>include &#39;jq-config.php&#39;;<br />// include the jqGrid Class<br />require_once "../includes/jquery/php/jqGrid.php";<br />// include the PDO driver class<br />require_once "../includes/jquery/php/jqGridPdo.php";<br />// Connection to the server<br />$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);<br />// Tell the db that we use utf-8<br />$conn-&#62;query("SET NAMES utf8");</p>
<p>// Create the jqGrid instance<br />$grid = new jqGridRender($conn);</p>
<p>// enable debugging<br />$grid-&#62;debug = true;</p>
<p>$grid-&#62;SelectCommand = "select uid,costid,date,truckno,trailerno,description,supplier,supplierref,paid,posted from costheader";</p>
<p>// set the ouput format to json<br />$grid-&#62;dataType = &#39;json&#39;;<br />// Let the grid create the model<br />$grid-&#62;setColModel();<br />// Set the url from where we obtain the data<br />$grid-&#62;setUrl(&#39;getCostheader.php&#39;);<br />// Set grid caption using the option caption<br />$grid-&#62;setGridOptions(array(<br />&#160;&#160;&#160; "caption"=&#62;"Onroad Costs from Operators",<br />&#160;&#160;&#160; "rowNum"=&#62;7,<br />&#160;&#160;&#160; "sortname"=&#62;"date",<br />&#160;&#160; &#160;"sortorder"=&#62;"desc",<br />&#160;&#160;&#160; "rowList"=&#62;array(7,30,50),<br />&#160;&#160; &#160;"height"=&#62;150,<br />&#160;&#160; &#160;"width"=&#62;940<br />&#160;&#160;&#160; ));</p>
<p>$grid-&#62;addCol(array("name"=&#62;"act"),"last");</p>
<p>// Change some property of the field(s)<br />$grid-&#62;setColProperty("uid", array("label"=&#62;"ID", "width"=&#62;20, "hidden"=&#62;true));<br />$grid-&#62;setColProperty("costid", array("label"=&#62;"CostID", "width"=&#62;20, "hidden"=&#62;true));<br />$grid-&#62;setColProperty("date", array("label"=&#62;"Date", "width"=&#62;80, "formatter"=&#62;"date", "formatoptions"=&#62;array("srcformat"=&#62; "Y-m-d", "newformat"=&#62;"d/m/Y")));<br />$grid-&#62;setColProperty("truckno", array("label"=&#62;"Truck", "width"=&#62;80));<br />$grid-&#62;setColProperty("trailerno", array("label"=&#62;"Trailer", "width"=&#62;80));<br />$grid-&#62;setColProperty("description", array("label"=&#62;"Description", "width"=&#62;160));<br />$grid-&#62;setColProperty("supplier", array("label"=&#62;"Supplier", "width"=&#62;100));<br />$grid-&#62;setColProperty("supplierref", array("label"=&#62;"Reference", "width"=&#62;70));<br />$grid-&#62;setColProperty("paid", array("label"=&#62;"Paid by Driver", "width"=&#62;70));<br />$grid-&#62;setColProperty("posted", array("label"=&#62;"Posted", "width"=&#62;40));<br />$grid-&#62;setColProperty("act", array("label"=&#62;"Actions", "width"=&#62;50));</p>
<p>// on select row we should post the member id to second table and trigger it to reload the data<br />$selectgrp = &#60;&#60;&#60;GRP<br />function(rowid, selected)<br />{<br />&#160;&#160;&#160; if(rowid != null) {<br />&#160;&#160; &#160;&#160;&#160; &#160;var rowd = $("#costheadlisting").getRowData(rowid);<br />&#160;&#160; &#160;&#160;&#160; &#160;var cstid = rowd.costid;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#costlineslist").jqGrid(&#39;setGridParam&#39;,{postData:{cid:cstid}});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#costlineslist").trigger("reloadGrid");<br />&#160;&#160;&#160; }<br />}<br />GRP;<br />$grid-&#62;setGridEvent(&#39;onSelectRow&#39;, $selectgrp);</p>
<p>// We should clear the grid data on second grid on sorting, paging, etc.<br />$cleargrid = &#60;&#60;&#60;CLEAR<br />function(rowid, selected)<br />{<br />&#160;&#160; // clear the grid data and footer data<br />&#160;&#160; jQuery("#costheadlisting").jqGrid(&#39;clearGridData&#39;,true);<br />}<br />CLEAR;</p>
<p>$grid-&#62;setGridEvent(&#39;onPaging&#39;, $cleargrid);<br />$grid-&#62;setGridEvent(&#39;onSortCol&#39;, $cleargrid);</p>
<p>$loadevent = &#60;&#60;&#60;LOADCOMPLETE<br />function(rowid){<br />&#160;&#160; &#160;var ids = jQuery("#costheadlisting").getDataIDs();<br />&#160;&#160; &#160;for(var i=0;i&#60;ids.length;i++){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var rowd = $("#costheadlisting").getRowData(ids[i]);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var cl = ids[i];<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var ptd = rowd.posted;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (ptd == &#39;N&#39;) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;be = &#39;&#60;img src="../images/into.png" title="Post Cost to Accounts" onclick="javascript:postcost(&#39;+cl+&#39;)" &#62;&#60;/ids&#62;&#39;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;} else {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;be = &#39;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#39;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#costheadlisting").setRowData(ids[i],{act:be}); <br />&#160;&#160; &#160;}<br />}<br />LOADCOMPLETE;</p>
<p>$grid-&#62;setGridEvent("loadComplete",$loadevent);</p>
<p>$grid-&#62;gSQLMaxRows = 4000;</p>
<p>// Enable navigator<br />$grid-&#62;navigator = true;<br />// Disable some actions<br />$grid-&#62;setNavOptions(&#39;navigator&#39;, array("excel"=&#62;true,"add"=&#62;false,"edit"=&#62;false,"del"=&#62;false,"view"=&#62;false));</p>
<p>// Run the script<br />$grid-&#62;renderGrid(&#39;#costheadlisting&#39;,&#39;#costheadlistingpager&#39;,true, null, null, true,true);</p>
<p>?&#62;<br />******************************************************************</p>
<p>Detail</p>
<p>&#60;?php<br />session_start();<br />//ini_set(&#39;display_errors&#39;, true);<br />require("../db.php");</p>
<p>include &#39;jq-config.php&#39;;</p>
<p>// include the jqGrid Class<br />require_once "../includes/jquery/php/jqGrid.php";<br />// include the PDO driver class<br />require_once "../includes/jquery/php/jqGridPdo.php";<br />// Connection to the server<br />$conn = new PDO(DB_DSN,DB_USER,DB_PASSWORD);<br />// Tell the db that we use utf-8<br />$conn-&#62;query("SET NAMES utf8");<br />// Get the needed parameters passed from the main grid</p>
<p>if(isset ($_REQUEST["cid"])) {<br />&#160;&#160;&#160; $id = jqGridUtils::Strip($_REQUEST["cid"]);<br />} else {<br />&#160;&#160; &#160;$id = 0;&#160;&#160; &#160;<br />}</p>
<p>// Create the jqGrid instance<br />$grid = new jqGridRender($conn);</p>
<p>// the actual query for the grid data<br />$grid-&#62;SelectCommand = "select uid,quantity,item,unitcost,total,gst from costlines where costid = ".$id;</p>
<p>// set the ouput format to json<br />$grid-&#62;dataType = &#39;json&#39;;</p>
<p>// Let the grid create the model<br />$grid-&#62;setColModel(null);</p>
<p>// Set the url from where we obtain the data<br />$grid-&#62;setUrl(&#39;getCostlines.php&#39;);</p>
<p>// Set some grid options<br />$grid-&#62;setGridOptions(array(<br />&#160;&#160;&#160; "rowNum"=&#62;7,<br />&#160;&#160;&#160; "sortname"=&#62;"uid",<br />&#160;&#160;&#160; "rowList"=&#62;array(7,50,100),<br />&#160;&#160; &#160;"height"=&#62;150,<br />&#160;&#160; &#160;"width"=&#62;940<br />&#160;&#160;&#160; ));</p>
<p>// Enable footerdata an tell the grid to obtain it from the request<br />$grid-&#62;setGridOptions(array("footerrow"=&#62;true,"userDataOnFooter"=&#62;true));</p>
<p>$grid-&#62;addCol(array("name"=&#62;"act"),"last");</p>
<p>// Change some property of the field(s)<br />$grid-&#62;setColProperty("uid", array("label"=&#62;"ID", "width"=&#62;25, "hidden"=&#62;true));<br />$grid-&#62;setColProperty("quantity", array("label"=&#62;"Quantity", "width"=&#62;70, "align"=&#62;"right","formatter"=&#62;"number"));<br />$grid-&#62;setColProperty("item", array("label"=&#62;"Item", "width"=&#62;190));<br />$grid-&#62;setColProperty("unitcost", array("label"=&#62;"Unit Cost", "width"=&#62;100, "align"=&#62;"right","formatter"=&#62;"number"));<br />$grid-&#62;setColProperty("total", array("label"=&#62;"Total", "width"=&#62;100, "align"=&#62;"right","formatter"=&#62;"number"));<br />$grid-&#62;setColProperty("gst", array("label"=&#62;"Tax", "width"=&#62;70, "align"=&#62;"right","formatter"=&#62;"number"));<br />$grid-&#62;setColProperty("act", array("label"=&#62;"Actions", "width"=&#62;50));</p>
<p>// At end call footerData to put total&#160; label<br />$grid-&#62;callGridMethod(&#39;#costlineslist&#39;, &#39;footerData&#39;, array("item",array("item"=&#62;"Total:")));<br />// Set which parameter to be sumarized<br />$summaryrows = array("total"=&#62;array("total"=&#62;"SUM"),"gst"=&#62;array("gst"=&#62;"SUM"));</p>
<p>$loadevent = &#60;&#60;&#60;LOADCOMPLETE<br />function(rowid){<br />&#160;&#160; &#160;var ids = jQuery("#costlineslist").getDataIDs();<br />&#160;&#160; &#160;for(var i=0;i&#60;ids.length;i++){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var rowd = $("#costlineslist").getRowData(ids[i]);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var cl = ids[i];<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;be = &#39;&#60;img src="../images/edit.png" title="Edit Transaction Details" onclick="javascript:editcost(&#39;+cl+&#39;)" &#62;&#60;/ids&#62;&#39;;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#costlineslist").setRowData(ids[i],{act:be}); <br />&#160;&#160; &#160;}<br />}<br />LOADCOMPLETE;</p>
<p>$grid-&#62;setGridEvent("loadComplete",$loadevent);</p>
<p>// Enable navigator<br />$grid-&#62;navigator = true;<br />// Disable some actions<br />$grid-&#62;setNavOptions(&#39;navigator&#39;, array("excel"=&#62;true,"add"=&#62;false,"edit"=&#62;false,"del"=&#62;false,"view"=&#62;false));</p>
<p>// Run the script<br />$grid-&#62;renderGrid(&#39;#costlineslist&#39;,&#39;#costlineslistpager&#39;,true, $summaryrows, null,true,true);<br />?&#62;</p></p>
]]></description>
        	        	<pubDate>Tue, 29 Jan 2013 02:28:12 +0200</pubDate>
        </item>
</channel>
</rss>