<?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: Coldfusion Json data Grouping Issue</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/coldfusion-json-data-grouping-issue</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/coldfusion-json-data-grouping-issue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>mayson on Coldfusion Json data Grouping Issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/coldfusion-json-data-grouping-issue#p24136</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/coldfusion-json-data-grouping-issue#p24136</guid>
        	        	<description><![CDATA[<p>Hi I&#39;m currently developing a whole suite of dashboards for my workplace and have hit an issue I cant work out and have searched every where for answers and have found none.</p>
</p>
<p>I&#39;m developing within the coldfusion environment and my grid loads and populates fine but the grouping that I have enabled is not working and I think it maybe my JSON data format but cant be sure.</p>
</p>
<p>My JSON format looks like this:</p>
<p>{"ROWS":[["Account Enquiry","Adding a  myki",77.0,105.0,-0.27,385.0,601.0,-0.36],["Account Enquiry","Archive  cards",0.0,64.0,0.00,451.0,17.0,25.53],["Account Enquiry","Cancelling an  account",27.0,52.0,-0.48,164.0,165.0,-0.01],["Account Enquiry","Change  of details",305.0,483.0,-0.37,2400.0,2311.0,0.04],["Account  Enquiry","Consolidate cards",0.0,84.0,0.00,685.0,45.0,14.22],["Account  Enquiry","Obtain  Balance",560.0,1272.0,-0.56,6828.0,3604.0,0.89],["Account  Enquiry","Removing a myki",16.0,28.0,-0.43,87.0,112.0,-0.22],["Account  Enquiry","Retrieve cards",0.0,13.0,0.00,56.0,1.0,55.00],["Account  Enquiry","Tax invoice  request",11.0,33.0,-0.67,103.0,42.0,1.45],["Account  Enquiry","Transaction  history",502.0,1035.0,-0.51,5370.0,3334.0,0.61]],"PAGE":1.0,"RECORDS":10,"TOTAL":1.0}</p>
</p>
<p>Using the following CFC.</p>
</p>
<p>&#60;cfcomponent displayname="InvoiceMgr"&#160; output="false"&#62;<br />&#60;cffunction name="getInvoices" access="remote" output="false" returnformat="json"&#62;<br />&#60;cfset invoices = ArrayNew(1) /&#62;<br />&#60;cfquery datasource="CS_1" name="q"&#62;<br />SELECT&#160; top 10&#160;&#160; name, segment, current_month, previous_month, convert(numeric(17,2),m_variance) as m_variance, current_year, previous_year, Convert(numeric(17,2),y_variance) as y_variance<br />FROM&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dbo.csg_disposition_dashboard_4<br />group by name, segment, current_month, previous_month, m_variance, current_year, previous_year,y_variance<br />order by name asc<br />&#60;/cfquery&#62;<br />&#60;cfloop query="q"&#62;<br />&#60;cfset invoices[currentrow] = [#name#,#segment#,#current_month#, #previous_month#,#m_variance#, #current_year#, #previous_year#,#y_variance#]&#62;<br />&#60;/cfloop&#62;<br />&#60;cfset str = {total=1, page=1, records=#q.recordcount#, rows=invoices}&#62;<br />&#60;cfreturn str /&#62;<br />&#60;/cffunction&#62;<br />&#60;/cfcomponent&#62;</p>
</p>
<p>The Javascript i&#39;m using is:</p>
<p>&#60;html&#62;<br />&#60;head&#62;<br />&#60;title&#62;jqGrid&#60;/title&#62;<br />&#160; &#60;link rel="stylesheet" type="text/css" href="/Jquery/themes/ui-darkness/jquery-ui-1.8.14.custom.css" /&#62;<br />&#160;&#160;&#160; &#60;link rel="stylesheet" type="text/css" href="/Jquery/css/ui.jqgrid.css" /&#62;<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; &#60;!--&#60;link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-3.7.2/css/ui.jqgrid.css" /&#62;--&#62;</p>
<p>&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/jquery-1.6.2.min.js"&#62;&#60;/script&#62;<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/js/jquery-ui-1.8.14.custom.min.js"&#62;&#60;/script&#62;<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/i18n/grid.locale-en.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.base.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.common.js"&#62;&#60;/script&#62;</p>
<p>&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.formedit.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.inlinedit.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.custom.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/jquery.fmatter.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.grouping.js"&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#60;script type="text/javascript" src="/Jquery/src/grid.treegrid.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/src/grid.jqueryui.js"&#62;&#60;/script&#62;</p>
<p>&#160;&#160; &#160;<br />&#160;&#160;&#160; &#60;!--&#60;script type="text/javascript" src="/Jquery/js/i18n/grid.locale-en.js"&#62;&#60;/script&#62;<br />&#160;&#160;&#160; &#60;script type="text/javascript" src="/Jquery/js/jquery.jqGrid.min.js"&#62;&#60;/script&#62;--&#62;<br />&#60;script type="text/javascript"&#62;<br />$(document).ready(function(){<br />$("#list").jqGrid({<br />url:&#39;contacts1.cfc?method=getInvoices&#39;,<br />datatype: &#39;json&#39;,<br />colNames:[&#39;Source&#39;,&#39;Segment&#39;,&#39;August&#39;,&#39;July&#39;,&#39;Variance&#39;,&#39;2011&#39;,&#39;2010&#39;,&#39;Variance&#39;],<br />colModel :[<br />{name:&#39;name&#39;,index:&#39;name&#39;, width:250, editable:true},<br />{name:&#39;segment&#39;,index:&#39;segment&#39;, width:200},<br />{name:&#39;current_month&#39;,index:&#39;current_month&#39;, width:100,align:"center",sorttype:"int",summaryType:&#39;sum&#39;},<br />{name:&#39;previous_month&#39;,index:&#39;previous_month&#39;, width:100,align:"center",sorttype:"int",summaryType:&#39;sum&#39;},<br />{name:&#39;m_variance&#39;,index:&#39;m_variance&#39;, width:80,align:"center",sorttype:"int",summaryType:&#39;avg&#39;},<br />{name:&#39;current_year&#39;,index:&#39;current_year&#39;, width:100,align:"center",sorttype:"int",summaryType:&#39;sum&#39;},<br />{name:&#39;previous_year&#39;,index:&#39;previous_year&#39;, width:100,align:"center",sorttype:"int",summaryType:&#39;sum&#39;},<br />{name:&#39;y_variance&#39;,index:&#39;y_variance&#39;, width:80,align:"center",sortable:false,summaryType:&#39;avg&#39;}],<br />pager: $(&#39;#pager&#39;),</p>
<p>rowList:[100,300,600,1000],<br />width: &#39;auto&#39;,<br />height: &#39;auto&#39;,<br />sortname: "name",<br />sortorder: "desc",<br />viewrecords: true,<br />jsonReader: {<br />root: "ROWS",<br />page: "PAGE",<br />total: "TOTAL",<br />cell: "",<br />id: "id",<br />caption: "Disposition Codes",<br />grouping:true,<br />groupingView : {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; groupField : [&#39;name&#39;],<br />&#160;&#160;&#160;&#160; groupDataSorted : true<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;</p>
<p>}}<br />);<br />});<br />&#60;/script&#62;<br />&#60;/head&#62;<br />&#60;body&#62;<br />&#60;table id="list" class="scroll"&#62; &#60;div id="pager" class="scroll" style="text-align:center;"&#62; &#60;/body&#62;<br />&#60;/html&#62;</p>
</p>
<p>I really would like some help on this as I&#39;m at the end of sanity,<img class="spSmiley" style="margin:0" title="Yell" src="/blog/wp-content/forum-smileys/sf-yell.gif" alt="Yell" /> head hitting desk.</p>
</p>
<p>Looking forward to someone knowing the answer.</p>
</p>
<p>Regards</p>
<p>Mayson</p>
]]></description>
        	        	<pubDate>Wed, 03 Aug 2011 09:34:25 +0300</pubDate>
        </item>
</channel>
</rss>