<?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: Customization Pager</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/customization-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/feature-request/customization-pager/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>hantangtieji on Customization Pager</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/customization-pager#p19157</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/customization-pager#p19157</guid>
        	        	<description><![CDATA[<p>I really appreciate and enjoy jqGrid and use it in some projects.But my customers are very strict about pager,they want to a pager style like &#160;"pre-ten &#160;11,12,13,14,15,16,17,18,19,20 &#160;next-ten".</p>
<p>I find no method to extend jqGrid to support the pager style. Maybe I could use loadComplete event for customization ,just like&#160;</p>
<p><span style="color: #3366ff;">$(document).ready(function()               {</span></p>
<p><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160;$("#myTable").jqGrid({</span></p>
<p><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;datatype: &#39;json&#39;,</span></p>
<p><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;pager:"#pager",</span></p>
<p><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;&#8230;&#8230;&#8230;&#8230;&#8230;.,</span></p>
<p style="padding-left: 60px; "><span style="color: #3366ff;">loadComplete:function(data)         {             var nav=$("#pager"+"_"+"left","#pager"); </span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;"> $("#dvCustomerPager",nav).remove();</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">var dvCustomerPager=$("&#60;div id=&#39;dvCustomerPager&#39; &#62;&#60;/div&#62;");</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">var curPage=parseInt($("#myTable").getGridParam("page"));</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">var itr;</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">for(var c=-4;c&#60;6;c++)</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">{</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160;itr=(curPage+c);</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">&#160;&#160; &#160; &#160; &#160;dvCustomerPager.append($("&#60;a href=&#39;#&#39; &#38;nbsp;style=&#39;margin:0px 3px 0px 3px;&#39; &#160;onclick=&#39;gotoPage("+itr+")&#39;&#62;"+itr+"&#60;/a&#62;"));</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">}</span></p>
<p style="padding-left: 90px; "><span style="color: #3366ff;">&#160;nav.append(dvCustomerPager);</span></p>
<p style="padding-left: 60px; "><span style="color: #3366ff;">&#160;}</span></p>
<p style="padding-left: 60px; "><span style="color: #3366ff;">});</span></p>
<p><span style="color: #3366ff;">});</span></p>
<p><span style="color: #3366ff;">&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></p>
<p><span style="color: #3366ff;">function gotoPage(thePage)</span></p>
<p><span style="color: #3366ff;">{</span></p>
<p><span style="color: #3366ff;">&#160;&#160; &#160; &#160;$("#myTable").setGridParam({page:thePage}).trigger("reloadGrid");</span></p>
<p><span style="color: #3366ff;">}</span></p>
</p>
<p>But I must copy these codes for every jqGrid instance .I want to find some methods to &#160;extend the $.fn or set $.jgrid.defaults.loadComplete&#160;so that it &#160;does effects for every jqGrid instance. So could you give a extention point to support customiztion pager. Or you may add another parameter &#160;that pass jqGrid instance &#160;itself in loadComplete event ,so that I can get the jqGrid instance and get its parameters. Or you may provide a afterPaging event and pass jqGrid instance to it , and then I could do something for customization pager.</p>
<p>In addition , I think a getNavBar() method that returns jgGrid instance&#39;s navigation bar(pager element) &#160;is neccessary.Because you may change navbar&#39;s id in the later version and my extension may lose efficacy .But if you provide getNavBar() , my extension will always work independent of any new version.</p>
<p>Thank you!</p>
]]></description>
        	        	<pubDate>Tue, 17 Aug 2010 08:07:28 +0300</pubDate>
        </item>
</channel>
</rss>