<?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: newb question- getting started</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/newb-question-getting-started</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/newb-question-getting-started/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>sJhonny on newb question- getting started</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/newb-question-getting-started#p22019</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/newb-question-getting-started#p22019</guid>
        	        	<description><![CDATA[</p>
<p>Hi,</p>
<p>I&#39;m trying to get started with jqgrid, but I&#39;m having trouble with a couple of things.</p>
<p>Firstly- getting the json data:</p>
<p>I define my table like so:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7170' value='Select Code' data-codeid='sfcode7170' /></p>
<div class='sfcode' id='sfcode7170'>$(&#34;#tblTerminals&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;SampleScriptService.asmx/GetAllTerminals&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: &#39;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#34;json&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: &#34;application/json; charset=utf-8&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#34;POST&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Id&#39;, &#39;Name&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;id&#39;, index: &#39;TerminalId&#39;, width: 55 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;name&#39;, index: &#39;Name&#39;, width: 90 }<br />&#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; rowNum: 10,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: &#39;#terminalsPager&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;id&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: &#34;desc&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#34;Terminals&#34;<br />&#160;&#160;&#160; });</div>
<p>but I get <strong>xml</strong> returned from my web service.</p>
<p> when I call my web service like so:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2185' value='Select Code' data-codeid='sfcode2185' /></p>
<div class='sfcode' id='sfcode2185'>
<div class=&#34;netInfoResponseText netInfoText &#34;>
<pre><div class=&#34;sfcode&#34;>$.ajax(<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: &#34;POST&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#34;SampleScriptService.asmx/GetAllTerminals&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: &#39;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: &#34;application/json; charset=utf-8&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: &#34;json&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function(result) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var terminal = result.d;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; console.log(&#34;got: &#34; + result.d);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; error: function(e) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#testDiv&#34;).text(&#34;found error- &#34; + e);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; });</div><br /></pre>
</div>
</div>
<div class="netInfoResponseText netInfoText ">
<pre>I get a json result:<br /><br /><div class="netInfoResponseText netInfoText ">{"d":{"__type":"ICTS.SmartQueue.ManagementWebSite.sample.SampleScriptService+Harta","total":1,"page":1,"records":1,"rows":[{"__type":"ICTS.SmartQueue.Controllers.PresentationObjects.TerminalPO","TerminalId":2,"Name":"test terminal 1"}]}}</div><br /><br />I&#39;m probably doing something wrong with the jqgrid options, but I don&#39;t know what.<br /><br />My second problem, you might have noticed already, is that i&#39;m not sure what the format of the response should be.<br />inside the rows element- every row should have an &#39;id&#39; element and &#39;cells&#39; collection that contain all the cells?<br /><br />thanks in advance,<br />Jhonny</pre>
</div>
]]></description>
        	        	<pubDate>Wed, 09 Feb 2011 17:40:09 +0200</pubDate>
        </item>
</channel>
</rss>