<?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: reloadGrid and Timers</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/reloadgrid-and-timers</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/reloadgrid-and-timers/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>AndrewPearce on reloadGrid and Timers</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reloadgrid-and-timers#p24500</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reloadgrid-and-timers#p24500</guid>
        	        	<description><![CDATA[<p>After trying a few more things I have worked out what was happening. No problem with jqgrid or timers, just my understanding of how asp.net works. When the Imagebutton was clicked it performed the reload but also did a postback and because I am only registiering the start up script when it is not postback when the page reloaded the timer was not initiated and therefore the reload function was never called again. So I have changed the control from an imagebutton to just an image (which doesn&#39;t perform a postback when it is clicked) and it is working as I had planned now.</p>
]]></description>
        	        	<pubDate>Thu, 01 Sep 2011 14:53:50 +0300</pubDate>
        </item>
        <item>
        	<title>AndrewPearce on reloadGrid and Timers</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/reloadgrid-and-timers#p24473</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/reloadgrid-and-timers#p24473</guid>
        	        	<description><![CDATA[<p>Hello All.</p>
<p>&#160; &#160;I am having trouble with timers and jqgrid. I have a single jqgrid on my page and I am using the javascript setInterval function to call a function every 10 minutes that calls reloadGrid to keep the contents of the grid updated. This works well.</p>
</p>
<p>&#160; &#160;Now I want to give the users a button they can click to refresh the grid straightaway. The button just calls the same javascript function (that calls reloadGrid). This works in itself but once that button has been used the grid is not updated automatically anymore. Alert() calls in the javascript function stop showing up. The &#39;manual&#39; refresh button works when it is pressed subsequent times though.</p>
</p>
<p>&#160; &#160; Has anybody got any ideas why this is happening or what I can do to keep the background refresh happening ? I have tried using the setTimeout function, I have tried stopping the timer with clearTimeout or clearInterval and then restarting the timer after the reloadGrid call but nothing seems to help. The automatic refresh function never gets called after the user manually runs the reloadGrid function ?!?!</p>
<p>There isn&#39;t much code to look at but here is what I am doing in case it helps:</p>
<p>javascript function that does the refresh:</p>
<p>&#160;function reloaddata() { &#160;</p>
<p>&#160; &#160; &#160; &#160;$("#table").trigger("reloadGrid");</p>
<p>}</p>
</p>
<p>// this is being run when the page loads ( 6 secs for testing, 10 minutes normally)</p>
<pre class="code"><p><input type='button' class='sfcodeselect' name='sfselectit4593' value='Select Code' data-codeid='sfcode4593' /></p><div class='sfcode' id='sfcode4593'>setInterval( "reloaddata()", 6000 );</div></pre>
<pre class="code"><p><input type='button' class='sfcodeselect' name='sfselectit4790' value='Select Code' data-codeid='sfcode4790' /></p><div class='sfcode' id='sfcode4790'><br /></div></pre>
<pre class="code"><p><input type='button' class='sfcodeselect' name='sfselectit3270' value='Select Code' data-codeid='sfcode3270' /></p><div class='sfcode' id='sfcode3270'>// and I have an image button that the user clicks to refresh the page straightaway</div></pre>
<pre class="code"><p><input type='button' class='sfcodeselect' name='sfselectit4821' value='Select Code' data-codeid='sfcode4821' /></p><div class='sfcode' id='sfcode4821'><pre class="code"><p><input type='button' class='sfcodeselect' name='sfselectit2406' value='Select Code' data-codeid='sfcode2406' /></p><div class='sfcode' id='sfcode2406'>&#60;asp:ImageButton ID="ImageButton1" runat="server" onclientclick="reloaddata()"</div></pre>
<p>ImageUrl="~/Images/reload.png" /&#62;</p>
</div>
<p>Thanks in advance for any help.</p>
<p>Andrew</p>
]]></description>
        	        	<pubDate>Tue, 30 Aug 2011 18:57:44 +0300</pubDate>
        </item>
</channel>
</rss>