<?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: Grid not reloading</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading</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/grid-not-reloading/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>violinssoundcool on Grid not reloading</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p6029</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p6029</guid>
        	        	<description><![CDATA[<p>With a lot of help from Nathan, I got it working.&#160; I made a lot of changes, and I&#39;m not sure exactly what was causing it not to work, but here&#39;s my current code:</p>
</p>
<p>&#160;function ElementWidth(elem)<br />&#160;&#160;{<br />&#160;&#160;&#160;var w = $(elem).outerWidth() -(8*5)-2<br />&#160;&#160;&#160;alert(w);<br />&#160;&#160;&#160;return w;<br />&#160;&#160;}<br />&#160;&#160;<br />&#160;&#160;function ChangeSalesRep()<br />&#160;&#160;{<br />&#160;&#160;&#160;var salesRep;<br />&#160;&#160;&#160;var surl<br />&#160;&#160;&#160;salesRep = document.getElementById("salesRepresentative").value;<br />&#160;&#160;&#160;if(salesRep=="")<br />&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;salesRep="0";<br />&#160;&#160;&#160;}<br />&#160;&#160;&#160;//alert(salesRep);<br />&#160;&#160;&#160;surl = "RINVINQS2?salesRepresentative="+salesRep;<br />&#160;&#160;&#160;$(&#39;#results&#39;).setGridParam({url:surl, hiddengrid:false});<br />&#160;&#160;&#160;$(&#39;#results&#39;).setGridParam({hiddengrid:false});<br />&#160;&#160;&#160;$(&#39;#results&#39;).trigger("reloadGrid");<br />&#160;&#160;}<br />&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160; $(document).ready(function()<br />&#160;&#160;{<br />&#160;&#160;&#160;var columnNames = [&#39;Customer Name&#39;,&#39;Quantity&#39;,&#39;Value&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;var columnModel = <br />&#160;&#160;&#160;[<br />&#160;&#160;&#160;&#160;{name:&#39;id&#39;, resizable:false, index:&#39;id&#39;, width:90, align:&#39;left&#39;},<br />&#160;&#160;&#160;&#160;{name:&#39;quantity&#39;, resizable:false, index:&#39;quantity&#39;, width:40, align:&#39;center&#39;},<br />&#160;&#160;&#160;&#160;{name:&#39;value&#39;, resizable:false, index:&#39;value&#39;, align:&#39;center&#39;, width:40}<br />&#160;&#160;&#160;];<br />&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;var gridwidth = $(&#39;.tableContainer&#39;).width();<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;gridwidth = gridwidth-26;<br />&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;$("#results").jqGrid(<br />&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: "rinvinqs2?salesRepresentative="+document.getElementById("salesRepresentative").value,<br />&#160;&#160;&#160;&#160;//hiddengrid:true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;colNames: columnNames,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;colModel: columnModel,<br />&#160;&#160;&#160;&#160;pager: $(&#39;#pager2&#39;),<br />&#160;&#160;&#160;&#160;pgtext: &#39; of&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;rowNum: 50,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;rowList: [10,20,50,100],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;imgpath: "../javascript/JQGrid/themes/coffee/images",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;sortname: &#39;quantity&#39;,<br />&#160;&#160;&#160;&#160;sortorder: "desc",<br />&#160;&#160;&#160;&#160;viewrecords: true,<br />&#160;&#160;&#160;&#160;caption: "Inventory Status By Sales Representative",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;width: gridwidth,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;height: &#39;200px&#39;,<br />&#160;&#160;&#160;&#160;multiselect: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;loadComplete: function()<br />&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;var udata = $(&#39;#results&#39;).getUserData();<br />&#160;&#160;&#160;&#160;&#160;$(&#39;#t_results&#39;).css("text-align","right").html("&#60;table style=\\"width: 100%;\\"&#62;&#60;tr&#62;&#60;td style=\\"width: 277px; text-align: right;\\"&#62;Total: &#38;nbsp;&#38;nbsp;&#60;/td&#62;&#60;td style=\\"width: 94px; text-align: center;\\"&#62;&#60;!--%totohwgt%--&#62;&#60;/td&#62;&#60;td style=\\"width: 63px; text-align: center;\\"&#62;100&#60;/td&#62;&#60;td style=\\"width: 74px; text-align: center;\\"&#62;&#60;!--%perLBCost%--&#62;&#60;/td&#62;&#60;td style=\\"width: 122px; text-align: center;\\"&#62;&#60;!--%totslswgt%--&#62;&#60;/td&#62;&#60;td style=\\"width: 86px; text-align: center;\\"&#62;&#60;!--%monthsSupply%--&#62;&#60;/td&#62;&#60;td style=\\"width: 86px; text-aign: center;\\"&#62;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62;");<br />&#160;&#160;&#160;&#160;&#160;$(&#39;#cb&#39;).prev().remove();<br />&#160;&#160;&#160;&#160;&#160;if($(&#39;#results&#39;).getGridParam("records")==0)<br />&#160;&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;//$(&#39;#noResults&#39;).dialog("open");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;var page = $(&#39;#results&#39;).getGridParam("page");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;var records = $(&#39;#results&#39;).getGridParam("records");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;var recordsPP = $(&#39;#results&#39;).getGridParam("rowNum");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;var x = records/recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;var returnArray = [];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;if(x &#60; page)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iterLimit = records%recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iterLimit = recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;for(var i=1; i&#60;=iterLimit; i++)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#&#39;+i).children(&#39;td:first&#39;).next().addClass(&#39;link&#39;).css("cursor","pointer").css("color","blue").css("text-decoration","underline");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;var ord = $(&#39;#&#39;+i).children(&#39;td:first&#39;).next().text();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;$(&#39;#&#39;+i).children(&#39;td:first&#39;).next().click(function()<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ord = $(this).text();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;window.location.href = "RINVINQS3?salesRepresentative="+document.getElementById("salesRepresentative").value;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;},<br />&#160;&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;subGrid: true,&#160; //If set to true this enables using a subgrid. If the subGrid is enabled, an additional column at left side is added to the basic grid. This column contains a &#39;plus&#39; image which indicates that the user can click on it to expand the row. By default all rows are collapsed.<br />&#160;&#160;&#160;&#160;subGridRowExpanded: function(subgrid_id, row_id) <br />&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;// subgrid_id is an id of the div tag created within a table<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;// the row_id is the id of the row<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;// If we want to pass additional parameters to the url we can use<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;// the method getRowData(row_id) - which returns associative array in type name-value<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;// here we can easily construct the following<br />&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;var subgrid_table_id;<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;subgrid_table_id = subgrid_id+"_t";<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;jQuery("#"+subgrid_id).html("&#60;table id=&#39;"+subgrid_table_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/table&#62;");<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;jQuery("#"+subgrid_table_id).jqGrid(<br />&#160;&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;<a href="&#34;RINVINQS3?id=&#34;+row_id+&#34;&#38;salesRep=&#34;+document.getElementById(&#34;salesRepresentative&#34;).value" target="_blank">url:"RINVINQS3?id="+row_id+"&#38;salesRep="+document.getElementById("salesRepresentative").value</a>,&#160; //specifies program to retrieve cell data<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;datatype: "json",&#160; //type of returned data<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;colNames: [&#39;&#60;div style="width: 100%; text-align: center;"&#62;Division&#60;br /&#62;Number&#60;/div&#62;&#39;,&#39;&#60;br /&#62;Name&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;&#60;br /&#62;On Hand Weight&#60;/div&#62;&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;% of&#60;br /&#62;Total&#60;/div&#62;&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;Per Lb&#60;br /&#62;Cost&#60;/div&#62;&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;Avg Monthly&#60;br /&#62;Sales Wgt&#60;/div&#62;&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;Months&#60;br /&#62;Supply&#60;/div&#62;&#39;,&#39;&#60;div style="width: 100%; text-align: center;"&#62;Turnover&#60;br /&#62;Rate&#60;/div&#62;&#39;],&#160; //column names<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;colModel: <br />&#160;&#160;&#160;&#160;&#160;&#160;[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;{name:"divisionNumber",index:"divisionNumber",width:60,key:true,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;{name:"divisionName",index:"divisionName",width:180,align:"left",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;{name:"onHandWeight",index:"onHandWeight",width:90,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;{name:"percentOfTotal",index:"percentOfTotal",width:50,align:"center",sortable:false},&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;{name:"perLbCost",index:"perLbCost",width:50,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:"avgMonthlyWeight",index:"avgMonthlySales",width:80,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:"monthsSupply",index:"monthsSupply",width:60,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;{name:"turnoverRate",index:"turnoverRate",width:60,align:"center",sortable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;//height: 100,&#160; //height of subgrid<br />&#160;&#160;&#160;&#160;&#160;&#160;width: 800,&#160; //width of subgrid<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;rowNum:20,&#160; //number of rows to display initially in subgrid<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;imgpath: "../javascript/JQGrid/themes/green/images",&#160; //what theme to use with subgrid<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;sortname: &#39;divisionNumber&#39;,&#160; //initial sorted column name<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;sortorder: "asc",&#160; //initial sort order<br />&#160;&#160;&#160;&#160;&#160;&#160;jsonReader:<br />&#160;&#160;&#160;&#160;&#160;&#160;{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;repeatitems: false<br />&#160;&#160;&#160;&#160;&#160;&#160;}&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;})<br />&#160;&#160;&#160;&#160;},<br />&#160;&#160;&#160;<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;shrinkToFit: true,<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;jsonReader:<br />&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;root: "rows",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;page: "page",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;total: "total",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;records: "records",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;repeatitems : false<br />&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;}<br />&#160;&#160; &#160;&#160;&#160;});<br />&#160;&#160;});</p>
]]></description>
        	        	<pubDate>Tue, 14 Apr 2009 13:21:53 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Grid not reloading</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p6002</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p6002</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I think you do not need to crate the grid every time you change the value from select box. Basically you need:</p>
<p>$(document).ready(function()<br />&#160;{</p>
<p>$("#mygrid").jqGrid({...});</p>
<p>$(&#39;#salesRepresentative&#39;).change(function()<br />&#160;{<br />&#160;&#160;&#160; &#160;&#160;&#160; var salesRep = $(this).val();</p>
<p>#("#mygrid").setGridParam({...}).triggre("reloadGrid");</p>
<p>}</p>
<p>});</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 14 Apr 2009 02:53:48 +0300</pubDate>
        </item>
        <item>
        	<title>violinssoundcool on Grid not reloading</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p5952</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p5952</guid>
        	        	<description><![CDATA[<p>I couldn&#39;t find an exact example of this, but I should be able to go off of the demonstration called &#8220;Search Big Sets.&#8221;&#160; The big difference was the following line:</p>
<p>$(&#39;#table_id&#39;).setGridParam({url:&#8221;pgmname?parameter1=&#8221;+</p>
<p>&#160; parameter1,page:1}).trigger(&#8221;reloadGrid&#8221;);&#160;&#160;&#160;</p>
<p>When I insert this line into my selectbox&#39;s .change() function, the JS bombs out and gives the following error message:</p>
<p>$(&#8221;#table_id&#8221;).setGridParam is not a function</p>
<p>I&#39;m currently at version 3.4.1.&#160; Does anyone have an idea what might be causing this?</p>
]]></description>
        	        	<pubDate>Fri, 10 Apr 2009 10:10:22 +0300</pubDate>
        </item>
        <item>
        	<title>violinssoundcool on Grid not reloading</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p5922</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-not-reloading#p5922</guid>
        	        	<description><![CDATA[<p>Hi.&#160; Once again, Tony, I think you&#39;ve done a marvelous job on this plugin.&#160; I&#39;m working on one that is populated based on what the user selects from a select box.&#160; So far, when the user selects the option, the grid is populated.&#160; However, when the user changes the option in the select box, the server side program is called again, but it passes the same parameters as the first call.&#160; Here is my code if it will help:</p>
<p>$(document).ready(function()<br />{<br />&#160;&#160;&#160; $(&#39;#salesRepresentative&#39;).change(function()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; var salesRep = $(this).val();<br />&#160;&#160;&#160; &#160;&#160;&#160; var columnNames = [&#39;Customer Name&#39;,&#39;Quantity&#39;,&#39;Value&#39;];<br />&#160;&#160;&#160; &#160;&#160;&#160; var columnModel = <br />&#160;&#160;&#160; &#160;&#160;&#160; [<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;id&#39;, resizable:false, index:&#39;id&#39;, width:90, align:&#39;left&#39;},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;quantity&#39;, resizable:false, index:&#39;quantity&#39;, width:40, align:&#39;center&#39;},<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;value&#39;, resizable:false, index:&#39;value&#39;, align:&#39;center&#39;, width:40}<br />&#160;&#160;&#160; &#160;&#160;&#160; ];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; var gridwidth = $(&#39;.tableContainer&#39;).width();<br />&#160;&#160;&#160; &#160;&#160;&#160; gridwidth = gridwidth-26;<br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; $("#results").trigger("reloadGrid").jqGrid(<br />&#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: "rinvinqs2?salesRepresentative="+$(&#39;#salesRepresentative&#39;).val(),&#160;&#160;</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datatype: "json", <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; mtype: &#39;GET&#39;, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colNames: columnNames, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colModel: columnModel,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;),&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; pgtext: &#39; of&#39;,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; rowNum: 50,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; rowList: [10,20,50,100],&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; imgpath: "../javascript/JQGrid/themes/coffee/images", <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortname: &#39;quantity&#39;,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortorder: "desc", <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; caption: "Inventory Status By Sales Representative",&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; width: gridwidth,&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; height: &#39;350px&#39;,&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; multiselect: false,&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; loadComplete: function()<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var udata = $(&#39;#results&#39;).getUserData();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $("#t_results").css("text-align","right").html("&#60;table style=\\"width: 100%;\\"&#62;&#60;tr&#62;&#60;td style=\\"width: 277px; text-align: right;\\"&#62;Total: &#38;nbsp;&#38;nbsp;&#60;/td&#62;&#60;td style=\\"width: 94px; text-align: center;\\"&#62;&#60;!--%totohwgt%--&#62;&#60;/td&#62;&#60;td style=\\"width: 63px; text-align: center;\\"&#62;100&#60;/td&#62;&#60;td style=\\"width: 74px; text-align: center;\\"&#62;&#60;!--%perLBCost%--&#62;&#60;/td&#62;&#60;td style=\\"width: 122px; text-align: center;\\"&#62;&#60;!--%totslswgt%--&#62;&#60;/td&#62;&#60;td style=\\"width: 86px; text-align: center;\\"&#62;&#60;!--%monthsSupply%--&#62;&#60;/td&#62;&#60;td style=\\"width: 86px; text-aign: center;\\"&#62;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;&#60;/td&#62;&#60;/tr&#62;&#60;/table&#62;");</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#cb&#39;).prev().remove();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if($("#results").getGridParam("records")==0)<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#noResults&#39;).dialog("open");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var page = $(&#39;#results&#39;).getGridParam("page");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var records = $(&#39;#results&#39;).getGridParam("records");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var recordsPP = $(&#39;#results&#39;).getGridParam("rowNum");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var x = records/recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var returnArray = [];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if(x &#60; page)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iterLimit = records%recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; else <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; iterLimit = recordsPP;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; for(var i=1; i&#60;=iterLimit; i++)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#&#39;+i).children(&#39;td:first&#39;).next().addClass(&#39;link&#39;).css("cursor","pointer").css("color","blue").css("text-decoration","underline");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var ord = $(&#39;#&#39;+i).children(&#39;td:first&#39;).next().text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $(&#39;#&#39;+i).children(&#39;td:first&#39;).next().click(function()<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ord = $(this).text();<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; window.location.href = "RINVINQS2?salesRepresentative="+salesRep;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160; &#160; &#160; &#160;&#160; },<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; subGrid: true,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; subGridRowExpanded: function(subgrid_id, row_id) <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var subgrid_table_id;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; subgrid_table_id = subgrid_id+"_t";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery("#"+subgrid_id).html("&#60;table id=&#39;"+subgrid_table_id+"&#39; class=&#39;scroll&#39;&#62;&#60;/table&#62;");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery("#"+subgrid_table_id).jqGrid(<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url:"RINVINQS3?customerName="+row_id,&#160; <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; datatype: "json",&#160; //type of returned data<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colNames: [&#39;Item&#39;,&#39;Quantity&#39;,&#39;Unit Price&#39;,&#39;Value&#39;,&#39;Warehouse&#39;],&#160; <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; colModel: <br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; [<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:"item",index:"item",width:80,key:true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:"quantity",index:"quantity",width:130},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:"unitPrice",index:"unitPrice",width:80,align:"right"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:"value",index:"value",width:80,align:"right"},&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:"warehouse",index:"warehouse",width:80,align:"right",sortable:true},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ],</p>
<p>&#160;&#160;&#160; &#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; width: 800, <br />&#160; &#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; rowNum: 20,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; imgpath: "../javascript/JQGrid/themes/coffee/images",&#160; <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortname: &#39;item&#39;,&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sortorder: "desc", <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jsonReader:<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; { <br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; repeatitems: false<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; })<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; },<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; shrinkToFit: true,&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jsonReader : <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; root: "rows",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; page: "page",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; total: "total",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; records: "records",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; repeatitems : false<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; });<br />&#160;&#160;&#160; });<br />});</p>
]]></description>
        	        	<pubDate>Tue, 07 Apr 2009 20:19:55 +0300</pubDate>
        </item>
</channel>
</rss>