<?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: Jqgrid doesn't reload when using pager</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-doesnt-reload-when-using-pager</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/jqgrid-doesnt-reload-when-using-pager/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>blackraist on Jqgrid doesn't reload when using pager</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-doesnt-reload-when-using-pager#p27929</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-doesnt-reload-when-using-pager#p27929</guid>
        	        	<description><![CDATA[<p>i want my jqgrid programmatically move next page with reloaded data. for example: every 5 seconds change page and get refreshed data. &#8212;&#62; datatype: &#39;json&#39; &#60;&#8212; is in loop() function. brings reloaded page, but it does not pass the next page. stuck on the first page. if i delete it goes the next page, but the page doesn&#39;t refresh.</p>
<p>i read and tried, tried, tried everything but no luck as of yet. Please help..</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit4590' value='Select Code' data-codeid='sfcode4590' /></p><div class='sfcode' id='sfcode4590'>    &#60;script&#62;
       function fill() {
        jQuery(&#34;#jqGrid&#34;).jqGrid({
            url: &#39;@Url.Content(&#34;~/Handler/GetAjaxGridData&#34;)&#39;,
            datatype: &#39;json&#39;,
            height: &#39;auto&#39;,
            altRows: true,
            loadonce:true,
            pager: &#39;#pager&#39;,
            rowNum: 3,
            colNames: [&#39;birim_adi&#39;, &#39;durum&#39;],
            colModel: [
                     { name: &#39;cell.birim_adi&#39;, index: &#39;birim_adi&#39; },
                      { name: &#39;cell.durum&#39;, index: &#39;durum&#39; }
            ],
            jsonReader: {
                repeatitems: false,
                root: function (obj) { return obj.rows; },
                page: function (obj) { return 1; },
                total: function (obj) { return 1; },
                records: function (obj) { return obj.rows.length; }
            },
            loadComplete: function (data) {
                var total_pages = $(&#34;#sp_1_pager&#34;).text(); // total pages
                $(&#39;#hdn_total_pages&#39;).val(total_pages);
            },
            ajaxGridOptions: { cache: false }
        });
    }
    function loop() {
        var i = 1;
        setInterval(function () {
            var total_pages = $(&#39;#hdn_total_pages&#39;).val();
            $(&#34;#jqGrid&#34;).setGridParam({
                datatype: &#39;json&#39;, // &#60;--When I delete it goes to another page, but the page does not refresh.
                page: i,
            }).trigger(&#39;reloadGrid&#39;);
            i++;
            if (i &#62; total_pages) { i = 1; }
        }, 5000);
    }
       &#60;/script&#62;
       &#60;script&#62;
        $(function () {
        fill();
        loop();
       });
       &#60;/script&#62;
&#60;table id=&#34;jqGrid&#34;&#62;&#60;/table&#62;
&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62;
&#60;input type=&#34;hidden&#34; id=&#34;hdn_total_pages&#34; value=&#34;1&#34; /&#62;</div></pre>
<p>and then my json like this:</p>
<pre class="default prettyprint prettyprinted"><p><input type='button' class='sfcodeselect' name='sfselectit9393' value='Select Code' data-codeid='sfcode9393' /></p><div class='sfcode' id='sfcode9393'>   {
&#34;total&#34;: 1,
&#34;page&#34;: 1,
&#34;records&#34;: 6,
&#34;rows&#34;: [
    {
        &#34;id&#34;: 1,
        &#34;cell&#34;: {
            &#34;birim_adi&#34;: &#34;a&#34;,
            &#34;durum&#34;: &#34;test&#34;
        }
    },
    {
        &#34;id&#34;: 2,
        &#34;cell&#34;: {
            &#34;birim_adi&#34;: &#34;b&#34;,
            &#34;durum&#34;: &#34;test1&#34;
        }
    },
    {
        &#34;id&#34;: 3,
        &#34;cell&#34;: {
            &#34;birim_adi&#34;: &#34;c&#34;,
            &#34;durum&#34;: &#34;test3&#34;
        }
    },
    {
        &#34;id&#34;: 4,
        &#34;cell&#34;: {
            &#34;birim_adi&#34;: &#34;d&#34;,
            &#34;durum&#34;: &#34;test4&#34;
        }
    }
]
   }</div></pre>
]]></description>
        	        	<pubDate>Tue, 18 Dec 2012 09:18:58 +0200</pubDate>
        </item>
</channel>
</rss>