<?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: Subgrid not working, WCF datatype = function</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function</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/subgrid-not-working-wcf-datatype-function/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>matt_lethargic on Subgrid not working, WCF datatype = function</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9842</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9842</guid>
        	        	<description><![CDATA[<p>Hey Tony,</p>
</p>
<p>Ha ha, just figured that out 10 mins ago, I thought the docs said subGridType.</p>
<p>Thanks</p>
</p>
<p>Matt</p>
<p><img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /></p>
]]></description>
        	        	<pubDate>Fri, 18 Sep 2009 05:23:16 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Subgrid not working, WCF datatype = function</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9834</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9834</guid>
        	        	<description><![CDATA[<p>Hello Matt,</p>
<p>Sorry for this error in the documentation. All the defined properties which contain datatype are in lower cases.</p>
<p>Just replace</p>
<p>subGridType: Function.createDelegate(this, this._FetchTravellerDetails),</p>
<p>with</p>
<p>subgridtype: Function.createDelegate(this, this._FetchTravellerDetails),</p>
</p>
<p>Corrected in the docs.</p>
<p>Thank you very much</p>
<p>Best Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Fri, 18 Sep 2009 04:25:42 +0300</pubDate>
        </item>
        <item>
        	<title>matt_lethargic on Subgrid not working, WCF datatype = function</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9800</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/subgrid-not-working-wcf-datatype-function#p9800</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>Have been working with jGrid for a week now and have got a basic grid with paging and sorting working fine. I&#39;ve now been asked to add a subgrid to show extended details of each row and my solution isn&#39;t work. The grid loads fine and show the data, but when I click on the &#39;+&#39; next to each row, the loading div is shown and the grid data disappears. Behind the scenes the function _FetchTravellers is called for the subgrid instead of _FetchTravellersDetails.</p>
<p>Am I doing something really wrong? Please excuse any stupidity as I&#39;m a .Net developer and have been working with jQuery and this grid for just over a week now! Please let me know if more information is required.</p>
</p>
<p>I&#39;m using ASP.NET and WCF to get the data.</p>
<p>jGrid 3.5.3</p>
</p>
<p>Here&#39;s my code for the grid:</p>
<p>$(&#39;#grid&#39;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: Function.createDelegate(this, this._FetchTravellers),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Code&#39;, &#39;FirstName&#39;, &#39;Surname&#39;, &#39;Email&#39;, &#39;Office&#39;, &#39;&#39;, &#39;&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#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;code&#39;, index: &#39;code&#39;, key: true, search: false, hidden: true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;firstname&#39;, index: &#39;firstname&#39;, sorttype: &#39;text&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;surname&#39;, index: &#39;surname&#39;, sorttype: &#39;text&#39; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;email&#39;, index: &#39;email&#39;, sorttype: &#39;text&#39;, width: 120 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;office&#39;, index: &#39;office&#39;, sorttype: &#39;text&#39;, width: 70 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;edit&#39;, index: &#39;edit&#39;, align: &#39;center&#39;, search: false, sortable: false, width: 55 },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;remove&#39;, index: &#39;remove&#39;, align: &#39;center&#39;, search: false, sortable: false, width: 80}],<br />&#160;&#160;&#160;&#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;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#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;&#160;&#160;&#160; pager: $(&#39;#grid&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: 300,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 550,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; root: "rows",<br />&#160;&#160;&#160;&#160;&#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;&#160;&#160;&#160;&#160; total: "total",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records: "records",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; repeatitems: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; id: "code", <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subgrid: { root: &#39;rows&#39;, repeatitems: false }<br />&#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; subGrid: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subGridType: Function.createDelegate(this, this._FetchTravellerDetails),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; subGridModel: [{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name: [&#39;one&#39;, &#39;two&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; index: [&#39;one&#39;, &#39;two&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mapping: [&#39;one&#39;, &#39;two&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:[100,100]}]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160; _FetchTravellers: function(postdata) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // do web request<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: this._ServicePath + &#39;/&#39; + this._ServiceFetchTravellersMethod,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: JSON.stringify(postdata),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: "application/json; charset=utf-8",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: Function.createDelegate(this, this._onDataFetchOk),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; error: Function.createDelegate(this, this._onDataFetchFailed)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; _onDataFetchOk: function(ajaxData, stat) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var thegrid = $(&#39;#&#39; + this._dataTableID)[0];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var jdata = JSON.parse(ajaxData.d);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; thegrid.addJSONData(jdata);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ids = $(&#39;#&#39; + this._dataTableID).getDataIDs();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (var i = 0; i &#60; ids.length; i++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var ft = ids[i];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editLink = "&#60;a href=\\"../FrequentTraveller/TravellerDetails.aspx?id=" + ft + "\\"&#62;edit&#60;/a&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; removeLink = "&#60;a href=\\"#\\"&#62;remove&#60;/a&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#&#39; + this._dataTableID).setRowData(ids[i], { edit: editLink });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#39;#&#39; + this._dataTableID).setRowData(ids[i], { remove: removeLink });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; _onDataFetchFailed: function(error) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $get(this.get_lblFeedbackID()).value = "There was a problem performing that search."<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; _FetchTravellerDetails: function(postdata) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // do web request<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: this._ServicePath + &#39;/GetFrequentTravellersDetails&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: JSON.stringify(postdata),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: "application/json; charset=utf-8",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function(jsondata,stat){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if(stat=="success") {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var thegrid = $(&#39;#&#39; + this._dataTableID)[0];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; thegrid.subGridJson(eval("("+jsondata.responseText+")"),rowidprm.id);<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; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; error: Function.createDelegate(this, this._onDataFetchFailed)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; _onDataDetailsFetchOk: function(ajaxData, stat) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var thegrid = $(&#39;#&#39; + this._dataTableID)[0];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var jdata = JSON.parse(ajaxData.d);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; thegrid.addJSONData(jdata);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; thegrid.subGridJson(eval("(" + ajaxData.responseText + ")"), rowidprm.id);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p></p>
]]></description>
        	        	<pubDate>Thu, 17 Sep 2009 09:02:26 +0300</pubDate>
        </item>
</channel>
</rss>