<?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 no load</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/data-no-load</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-no-load/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>eddiehuihk on data no load</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/data-no-load#p24950</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/data-no-load#p24950</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>I&#160; am now trying to using jdGrid and load the data returned by WCF.</p>
<p>I can successfully retreive the data in json format but i fall to load the data into the grid.</p>
</p>
<p>Here&#39;s what I write:</p>
<p>var service_endpoint = "http://127.0.0.1:49303/Service1.svc/";<br />&#160;&#160; &#160;$("#list2&#8243;).jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;url : service_endpoint + "GetUsers",<br />&#160;&#160; &#160;&#160;&#160; &#160;datatype : "json",<br />&#160;&#160; &#160;&#160;&#160; &#160;jsonReader : {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;root : "rows",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;page : "page",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;total : "total",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;records : "records",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;repeatitems : false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;id : "Username"<br />&#160;&#160; &#160;&#160;&#160; &#160;},<br />&#160;&#160; &#160;&#160;&#160; &#160;colNames : [&#39;Username&#39;, &#39;Userteam&#39;,&#39;Usertitle&#39;,&#39;Useraccount&#39;],<br />&#160;&#160; &#160;&#160;&#160; &#160;colModel : [{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name : &#39;Username&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index : &#39;Username&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width : 60,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;align : "right"<br />&#160;&#160; &#160;&#160;&#160; &#160;}, {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name : &#39;Userteam&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index : &#39;Userteam&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width : 120,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortable : false<br />&#160;&#160; &#160;&#160;&#160; &#160;}, {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name : &#39;Usertitle&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index : &#39;Usertitle&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width : 120,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortable : false<br />&#160;&#160; &#160;&#160;&#160; &#160;}, {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;name : &#39;Useraccount&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index : &#39;Useraccount&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width : 120,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;sortable : false<br />&#160;&#160; &#160;&#160;&#160; &#160;}],<br />&#160;&#160; &#160;&#160;&#160; &#160;pager : &#39;#pager2&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;rowNum : 10,<br />&#160;&#160; &#160;&#160;&#160; &#160;rowList : [10, 20, 30],<br />&#160;&#160; &#160;&#160;&#160; &#160;sortname : &#39;Username&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;viewrecords : true,<br />&#160;&#160; &#160;&#160;&#160; &#160;sortorder : "asc",<br />&#160;&#160; &#160;&#160;&#160; &#160;caption : "Users"<br />&#160;&#160; &#160;}).navGrid(&#39;#pager2&#39;, { edit: false, add: false, del: false, view: false, refresh: false });</p>
</p>
<p>wcf response:</p>
<p>HTTP/1.1 200 OK<br />Server: ASP.NET Development Server/10.0.0.0<br />Date: Fri, 21 Oct 2011 04:21:23 GMT<br />X-AspNet-Version: 2.0.50727<br />Cache-Control: private<br />Content-Type: application/json; charset=utf-8<br />Content-Length: 1039<br />Connection: Close</p>
<p>{"page":1,"records":159,"rows":[{"Useraccount":"","Username":"","Userteam":"","Usertitle":""},{"Useraccount":"awa840","Username":"awa840","Userteam":"TESTA","Usertitle":"TEST"}],"total":16}</p>
</p>
<p>The data returns seems in correct format but the data is not loaded into the grid. Have I missed anything?</p>
<p>Thanks very much.</p>
]]></description>
        	        	<pubDate>Fri, 21 Oct 2011 07:24:49 +0300</pubDate>
        </item>
</channel>
</rss>