<?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: Data not showing C# asp.net MVC</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc</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/data-not-showing-c-asp-net-mvc/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>maitopoika on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15779</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15779</guid>
        	        	<description><![CDATA[<p>Thank you for the advice on using url.Content I will do that for sure.</p>
</p>
<p>I actually figured out what the problem was. I am using MVC2, with that I needed to add the following to my controller return statement</p>
<p>JsonRequestBehavior.AllowGet</p>
<p>so the return now looks like:</p>
<p>return Json(jsondata,JsonRequestBehavior.AllowGet);</p>
</p>
<p>and it works perfectly!</p>
<p>I appreciate your help, you really helped me understand what was working and that I needed to look else where in the code to find the problem.</p>
]]></description>
        	        	<pubDate>Wed, 17 Mar 2010 18:17:22 +0200</pubDate>
        </item>
        <item>
        	<title>yial2 on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15768</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15768</guid>
        	        	<description><![CDATA[<p>Here is the client code I used</p>
<p><input type='button' class='sfcodeselect' name='sfselectit4371' value='Select Code' data-codeid='sfcode4371' /></p>
<div class='sfcode' id='sfcode4371'>&#160;&#160;&#160; $(&#34;#list2&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;&#60;%= Url.Content(&#34;~/Home/Test4Data/&#34;) %&#62;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#34;json&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Invoice&#39;, &#39;Company&#39;, &#39;Model&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;invoice&#39;, index: &#34;invoice&#34;, width: 50, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;company&#39;, index: &#34;company&#34;, width: 100, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;descript&#39;, index: &#34;descript&#34;, width: 100, align: &#39;left&#39;}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: &#39;&#60;%= Url.Content(&#34;~/Scripts/jqueryUI/css/ui-lightness/images&#34;) %&#62;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;auto&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: &#39;400&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;invoice&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;Desc&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#34;&#34;<br />&#160;&#160;&#160; });</div>
<p>Beside my div name "list2", imagpath, and url, there are really no difference. I am also puzzled why yours do not work.</p>
<p>I recommend you to using MVC "Url.Content" to resolve the url, just a better practice.</p></p>
]]></description>
        	        	<pubDate>Wed, 17 Mar 2010 09:53:52 +0200</pubDate>
        </item>
        <item>
        	<title>maitopoika on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15765</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15765</guid>
        	        	<description><![CDATA[<p>ok still nothing. I am doing something seriously wrong, because i cannot even get any tutorials to work when I walk through them step by step</p>
<p>here is&#160; everything I have please help if you can. I have been battling this all day for three days now. Very frustrating.</p>
<p>i simplified it even more than on my original post.</p>
<p>here is my view</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3772' value='Select Code' data-codeid='sfcode3772' /></p>
<div class='sfcode' id='sfcode3772'>
<p>&#60;%@ Page Language=&#34;C#&#34; Inherits=&#34;System.Web.Mvc.ViewPage&#34; %&#62;</p>
<p>&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#038;gt" rel="nofollow" target="_blank"><a href="http://www.w3.org/TR/xhtml1/DT" rel="nofollow">http://www.w3.org/TR/xhtml1/DT</a>.....t;&#038;gt</a>;</p>
<p>&#60;html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml&#038;quot" rel="nofollow" target="_blank">http://www.w3.org/1999/xhtml&#038;quot</a>; &#62;<br />&#60;head runat=&#34;server&#34;&#62;<br />&#160;&#160;&#160; &#60;title&#62;ShowData&#60;/title&#62;<br />&#160;&#160;&#160; &#60;link href=&#34;../../Content/CSS/startTheme/jquery-ui-1.8rc3.custom.css&#34; rel=&#34;stylesheet&#34;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&#34;text/css&#34; /&#62;<br />&#160;&#160;&#160; &#60;link href=&#34;../../Content/CSS/ui.jqgrid.css&#34; rel=&#34;stylesheet&#34; type=&#34;text/css&#34; /&#62;<br />&#160;&#160;&#160; &#60;script src=&#34;../../Scripts/jquery-1.4.1.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script src=&#34;../../Scripts/grid.locale-en.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script src=&#34;../../Scripts/jquery.jqGrid.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#60;/head&#62;</p>
<p>&#60;body&#62;<br />&#160;&#160;&#160; &#60;div&#62;<br />&#160;&#160;&#160; &#60;h2&#62;Complete Unpaid&#60;/h2&#62;<br />&#160;<br />&#60;table id=&#34;completeUnPaidList&#34;&#62;&#60;/table&#62;<br />&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62;<br />&#60;/div&#62;<br />&#160;&#60;script type=&#34;text/javascript&#34;&#62;<br />&#160;&#160;&#160;&#160; var gridimgpath = &#39;../../Content/CSS/startTheme/Images/&#39;;<br />&#160;&#160;&#160;&#160; var gridDataUrl = &#39;Home/JsonCompletedNotPayed/&#39;;<br />&#160;&#160;&#160;&#160; jQuery(&#34;#completeUnPaidList&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: gridDataUrl,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#34;json&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Invoice&#39;, &#39;Company&#39;, &#39;Model&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;invoice&#39;, index: &#34;invoice&#34;, width: 50, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;company&#39;, index: &#34;company&#34;, width: 100, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;descript&#39;, index: &#34;descript&#34;, width: 100, align: &#39;left&#39;}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: gridimgpath,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;auto&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: &#39;400&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;invoice&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;Desc&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#34;&#34;<br />&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160; $(function() {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Set the grid json url to get the data to display<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; setGridUrl();<br />&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160; function setGridUrl() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Get the start and end dates entered<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var newGridDataUrl = gridDataUrl;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Set the parameters in the grid data source<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#completeUnPaidList&#39;).jqGrid(&#39;setGridParam&#39;, { url: newGridDataUrl }).trigger(&#34;reloadGrid&#34;);<br />&#160;&#160;&#160;&#160; }<br />&#160;&#60;/script&#62;</p>
<p>&#160;&#160;&#160; &#60;/div&#62;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
</div>
<p>here is my controller</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2469' value='Select Code' data-codeid='sfcode2469' /></p>
<div class='sfcode' id='sfcode2469'>
<p>&#160;public ActionResult JsonCompletedNotPayed(DateTime start, DateTime end, string sidx, string sord, int page, int rows)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var dataJson = new<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total = 1,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page = page,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = 5,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = new[]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 1, cell = new string[] {&#34;abc1&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 2, cell = new string[] {&#34;abc2&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 3, cell = new string[] {&#34;abc3&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 4, cell = new string[] {&#34;abc4&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 5, cell = new string[] {&#34;abc5&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Json(dataJson);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
</div>
<p>now when i run it and put a break point in the controller, it never gets there, and I just get a page with the top and bottom of the grid</p>
]]></description>
        	        	<pubDate>Tue, 16 Mar 2010 23:58:40 +0200</pubDate>
        </item>
        <item>
        	<title>yial2 on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15762</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15762</guid>
        	        	<description><![CDATA[<p>Hmmm&#8230;</p>
<p>I have tried your code with static data in MVC control as following&#8230;</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1787' value='Select Code' data-codeid='sfcode1787' /></p>
<div class='sfcode' id='sfcode1787'>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var dataJson = new<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total = 1,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page = page,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = 5,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = new[]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 1, cell = new string[] {&#34;abc1&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 2, cell = new string[] {&#34;abc2&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 3, cell = new string[] {&#34;abc3&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 4, cell = new string[] {&#34;abc4&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; new {id = 5, cell = new string[] {&#34;abc5&#34;, &#34;1&#34;, &#34;a&#34;}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Json(dataJson);</p>
</div>
<p> and it is working just fine.Give it a try and see if you get the grid to show up.</p>
]]></description>
        	        	<pubDate>Tue, 16 Mar 2010 20:15:25 +0200</pubDate>
        </item>
        <item>
        	<title>maitopoika on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15756</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15756</guid>
        	        	<description><![CDATA[<blockquote>
<p>&#160;</p>
<p>Have you tried to put a break point on your controller and see if the grid is actually calling JsonCompletedNotPayed?</p>
</p>
</blockquote>
<hr />
<p>Yes, I have done this. And it does go into the controller run the code and return a Json result set. But still no data shows.</p>
]]></description>
        	        	<pubDate>Tue, 16 Mar 2010 16:23:05 +0200</pubDate>
        </item>
        <item>
        	<title>yial2 on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15746</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15746</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Have you tried to put a break point on your controller and see if the grid is actually calling JsonCompletedNotPayed?</p>
<p>I think you should initialized JqGrid inside JQuery ready function:</p>
<pre id="line15"><p><input type='button' class='sfcodeselect' name='sfselectit7193' value='Select Code' data-codeid='sfcode7193' /></p><div class='sfcode' id='sfcode7193'>$(function() {<br />//Initialized JqGrid here<br />});</div></pre>
<p>E.g. <a href="http://www.grainfarmltd.com/testing" target="_blank">Check the javascript on this page</a> (scroll all the way to the bottom to click on pop up to see the JqGrid)</p>
]]></description>
        	        	<pubDate>Tue, 16 Mar 2010 06:46:33 +0200</pubDate>
        </item>
        <item>
        	<title>maitopoika on Data not showing C# asp.net MVC</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15744</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-not-showing-c-asp-net-mvc#p15744</guid>
        	        	<description><![CDATA[<p>I am trying to use jqGrid to display data. How ever the data is just not displaying, and I get no errors at all.</p>
<p>The graphics of the grid are showing and it acts like it completes normally, but with no data in the grid. I have verified that my controller method is in fact returning the expected data in Json format.</p>
<p>Here is my script</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit514' value='Select Code' data-codeid='sfcode514' /></p>
<div class='sfcode' id='sfcode514'>
<p>&#60;h2&#62;Complete Unpaid&#60;/h2&#62;<br />&#160;<br />&#60;table id=&#34;completeUnPaidList&#34;&#62;&#60;/table&#62;<br />&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62;<br />&#60;/div&#62;<br />&#160;&#60;script type=&#34;text/javascript&#34;&#62;<br />&#160;&#160;&#160;&#160; var gridimgpath = &#39;../../../../Content/CSS/startTheme/Images&#39;;<br />&#160;&#160;&#160;&#160; var gridDataUrl = &#39;DealerServices/JsonCompletedNotPayed&#39;;<br />&#160;&#160;&#160;&#160; jQuery(&#34;#completeUnPaidList&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: gridDataUrl,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#34;json&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Invoice&#39;, &#39;Company&#39;, &#39;Model&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;invoice&#39;, index: &#34;invoice&#34;, width: 50, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;company&#39;, index: &#34;company&#34;, width: 100, align: &#39;left&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;descript&#39;, index: &#34;descript&#34;, width: 100, align: &#39;left&#39;}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: gridimgpath,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: &#39;auto&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: &#39;400&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;invoice&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;Desc&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#34;&#34;<br />&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160; $(function() {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Set the grid json url to get the data to display<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; setGridUrl();<br />&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160; function setGridUrl() {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Get the start and end dates entered<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var newGridDataUrl = gridDataUrl;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // Set the parameters in the grid data source<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery(&#39;#completeUnPaidList&#39;).jqGrid(&#39;setGridParam&#39;, { url: newGridDataUrl }).trigger(&#34;reloadGrid&#34;);<br />&#160;&#160;&#160;&#160; }<br />&#160;&#60;/script&#62;</p>
</div>
<p>here is my controller method</p>
<p>&#160;</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7014' value='Select Code' data-codeid='sfcode7014' /></p>
<div class='sfcode' id='sfcode7014'>
<p>&#160;public ActionResult JsonCompletedNotPayed(string sidx, string sord, int page, int rows)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; SpaService SpaSvc = new SpaService(spaRepository);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&#60;SpaOrder&#62; context = SpaSvc.GetSpaOrdersCompleteNotPaid();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int pageIndex = Convert.ToInt32(page) - 1;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int pagesize = rows;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int totalrecords = context.Count();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int totalPages = (int)Math.Ceiling((float)totalrecords / (float)pagesize);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //string orderBy = string.Format(&#34;{0} {1}&#34;, sidx, sord);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var spas = context.AsQueryable()<br />&#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; //.OrderBy(orderBy)<br />&#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; .Skip(pageIndex * pagesize)<br />&#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; .Take(pagesize);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //format data for the grid<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var jsondata = new<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; total = totalPages,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page = page,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = totalrecords,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = (from s in spas<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; select new<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#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 = new string[]{<br />&#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; s.invoice.ToString(),<br />&#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; s.company,<br />&#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; s.descript<br />&#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; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }).ToArray()<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Json(jsondata);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
</div>
]]></description>
        	        	<pubDate>Tue, 16 Mar 2010 00:17:35 +0200</pubDate>
        </item>
</channel>
</rss>