<?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: Dynamic colNames, colModel and paging</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colnames-colmodel-and-paging</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/dynamic-colnames-colmodel-and-paging/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>lettherebegrid on Dynamic colNames, colModel and paging</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colnames-colmodel-and-paging#p27144</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colnames-colmodel-and-paging#p27144</guid>
        	        	<description><![CDATA[<p>My test shows that upon paging, my web method at /Url/To/GetColNamesAndColModels will not be hit. &#160;</p>
<p>Any idea on how I can reconstruct colNames and colModel at paging? &#160;Thank you.</p>
]]></description>
        	        	<pubDate>Tue, 14 Aug 2012 20:30:27 +0300</pubDate>
        </item>
        <item>
        	<title>lettherebegrid on Dynamic colNames, colModel and paging</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/dynamic-colnames-colmodel-and-paging#p27142</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/dynamic-colnames-colmodel-and-paging#p27142</guid>
        	        	<description><![CDATA[<p>I want to use jqGrid with paging and sorting for my asp.net mvc web site.&#160;</p>
<p>My colNames (and therefore colModel) are not known at design time. &#160;They need to be generated at run time.</p>
<p>And <span style="color: #ff0000;"><span style="text-decoration: underline;">each paging of the grid will give me a different set of colNames</span>.</span></p>
<p>I know that I need to do something like this:</p>
<p>$.ajax({</p>
<p><span style="white-space: pre;"> </span><span style="text-decoration: underline;"><strong>url: "/Url/To/GetColNamesAndColModels",</strong></span><br />&#160; &#160; &#160; &#160; dataType: "json",<br />&#160; &#160; &#160; &#160; type: &#39;POST&#39;,<br />&#160; &#160; &#160; &#160; success: function(result) {<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var myColNames = result.ColumnNames;<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var myColModel = result.ColumnModel;</p>
<p>&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$("#myGrid").jqGrid({<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; <span style="text-decoration: underline;"><strong>url: &#39;/Url/To/GetData&#39;,</strong></span><br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; dataType: &#39;POST&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; colModel: myColModel,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; colNames: myColNames,<br />&#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; pager: &#39;#myGridPager&#39;,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; viewrecords: true,<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; gridview: true<br />&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;});</p>
<p>});</p>
<p>My web service method GetColNamesAndColModels needs to know the sort index (sidx), the sort order (sord), the page index (page) and the page size (rows) as in the standard jqGrid post parameters: (string sidx, string sord, int page, int rows). &#160;How can I can pass such parameters to GetColNamesAndColModels upon paging?</p>
]]></description>
        	        	<pubDate>Tue, 14 Aug 2012 19:46:50 +0300</pubDate>
        </item>
</channel>
</rss>