<?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: Problem of size, sorting and freezing</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-of-size-sorting-and-freezing</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/problem-of-size-sorting-and-freezing/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Kris-I on Problem of size, sorting and freezing</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-of-size-sorting-and-freezing#p22666</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-of-size-sorting-and-freezing#p22666</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>In an ASP.NET MVC 3 (with razor) application I use jqGrid (latest version). The first time I arrive on the page, no problem, but I have several trouble</p>
<p>1. Only one column is sortable, not 3 as configured in the code</p>
<p>2. All the links on the page a block (not usable), except the sorting on the column</p>
<p>3. the Width is not 100%</p>
<p>See the code below,</p>
<p>Thanks,</p>
<p>I use this code :</p>
<pre>&#60;script&#160;type="text/javascript"&#62;
	jQuery(document).ready(function&#160;()&#160;{
		jQuery("#list2").jqGrid({
			url:&#160;&#39;/Customer/DynamicGridData/&#39;,
			datatype:&#160;&#39;json&#39;,
			mtype:&#160;&#39;GET&#39;,
			colNames:&#160;[&#39;Id&#39;,&#160;&#39;Code&#39;,&#160;&#39;Name&#39;],
			colModel:&#160;[
				{&#160;name:&#160;&#39;Id&#39;,&#160;index:&#160;&#39;Id&#39;,&#160;align:&#160;&#39;left&#39;,&#160;sortable:&#160;true&#160;},
				{&#160;name:&#160;&#39;Code&#39;,&#160;index:&#160;&#39;Code&#39;,&#160;align:&#160;&#39;left&#39;,&#160;sortable:&#160;true&#160;},
				{&#160;name:&#160;&#39;Name&#39;,&#160;index:&#160;&#39;Name&#39;,&#160;align:&#160;&#39;left&#39;,&#160;sortable:&#160;true&#160;}
			],
			pager:&#160;jQuery(&#39;#pager2&#39;),
			rowNum:&#160;10,
			rowList:&#160;[5,&#160;10,&#160;20,&#160;50],
			sortname:&#160;&#39;Code&#39;,
			sortorder:&#160;&#39;desc&#39;,
			viewrecords:&#160;true,
			caption:&#160;&#39;My&#160;first&#160;grid&#39;
		});
	});
&#60;/script&#62;
 
&#60;table&#160;id="list2"&#160;style="width:100%;"&#62;&#60;/table&#62;
&#60;div&#160;id="pager2"&#160;style="width:100%;"&#62;&#60;/div&#62;</pre>
</p>
<pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public&#160;ActionResult&#160;DynamicGridData(string&#160;sidx,&#160;string&#160;sord,&#160;int&#160;page,&#160;int&#160;rows)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;IList&#60;Client&#62;&#160;list&#160;=&#160;GetList();
 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;pageIndex&#160;=&#160;Convert.ToInt32(page)&#160;-&#160;1;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;pageSize&#160;=&#160;rows;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;totalRecords&#160;=&#160;list.Count;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;totalPages&#160;=&#160;(int)Math.Ceiling(totalRecords&#160;/&#160;(float)pageSize);
 
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;jsonData&#160;=&#160;new
&#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;total&#160;=&#160;totalPages,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;page,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;records&#160;=&#160;totalRecords,
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;rows&#160;=&#160;(from&#160;item&#160;in&#160;list
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;select&#160;new
&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;i&#160;=&#160;item.Id,
&#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;cell&#160;=&#160;new[]
&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;item.Id.ToString(),&#160;item.Code.ToUpper(),&#160;item.Name
&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}).ToArray()
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;};
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;return&#160;Json(jsonData,&#160;JsonRequestBehavior.AllowGet&#160;);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</pre>
]]></description>
        	        	<pubDate>Sun, 03 Apr 2011 20:00:31 +0300</pubDate>
        </item>
</channel>
</rss>