<?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: remapping columns issue</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/remapping-columns-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/remapping-columns-issue/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on remapping columns issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/remapping-columns-issue#p30937</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/remapping-columns-issue#p30937</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Â </p>
<p>You put the function populateGrid in datetype parameter</p>
<p>Â </p>
<p>datatype: populateGrid</p>
<p>Â </p>
<p>This is wrong. Note that if a date type is function it is called every time (instead that you set loadonce true)Â  you want to do something with the data - serach and etc...</p>
<p>One possible solutuion is after this is completed you can set a datetype again to local usin setGridparam</p>
<p>Â </p>
<p>Regards</p>
]]></description>
        	        	<pubDate>Mon, 11 Aug 2014 14:15:51 +0300</pubDate>
        </item>
        <item>
        	<title>_Chris on remapping columns issue</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/remapping-columns-issue#p30922</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/remapping-columns-issue#p30922</guid>
        	        	<description><![CDATA[<p>Because the server software I'm using (coldfusion) uses a non-standard JSON format, I'm having to remap the columns.</p>
<p>Unfortunately, once I do this, when using the toolbar search boxes, the grid queries the server rather than doing so locally -- I set the loadonce:true parameter so that it would not query the server after the initial load.</p>
<p>Can anyone help me with this?</p>
<p>var gridCols = {set:false};</p>
<p>$(document).ready(function(){<br />
 var grid = $('#gridTest'); // JQuery object reference of table used for our grid display</p>
<p> /*<br />
 * FUNCTION populateGrid<br />
 * Used as the 'datatype' attribute of the jqGrid config object, this method<br />
 * is used to handle the ajax calls and data manipulation needed to populate<br />
 * data within our jqGrid instance.<br />
 * @postdata (object) - this is the object passed as the 'postData' attribute<br />
 * of our jqGrid instance.<br />
 */<br />
 var populateGrid = function (postdata) {<br />
 $.ajax({<br />
 url: './cfc/Schools.cfc',<br />
 data:postdata,<br />
 method:'GET',<br />
 dataType:"json",<br />
 success: function(d,r,o){<br />
 if(d.SUCCESS){<br />
 // If loading for the first time, let's find out to which<br />
 // array positions our columns map.<br />
 if(!gridCols.set){<br />
 for(var i in d.DATA.COLUMNS){<br />
 gridCols[d.DATA.COLUMNS[i]] = parseInt(i);<br />
 }<br />
 gridCols.set = true;<br />
 }<br />
 grid.jqGrid('setGridParam',{remapColumns:[<br />
 gridCols['SCH_ID'],<br />
 gridCols['SCH_NAME'],<br />
 gridCols['SCH_LOCATION_NAME'],<br />
 gridCols['SCH_IMAGE_FILENAME'],<br />
 gridCols['SCH_ACTIVE'],<br />
 gridCols['CONFERENCENAME'],<br />
 gridCols['SUBCONFERENCENAME']<br />
 ]});<br />
 grid[0].addJSONData(d);<br />
 } else {<br />
 alert(d.MESSAGE);<br />
 }<br />
 }<br />
 });<br />
 };</p>
<p> grid.jqGrid({<br />
 loadonce: true,<br />
 gridview: true,<br />
 autowidth: true,<br />
 caption: 'Schools',</p>
<p> loadui: 'block',<br />
 altRows: true,<br />
 deepempty: true,<br />
 viewrecords: true,<br />
 sortname: 'SCH_NAME',<br />
 sortorder: 'asc',<br />
 colNames:['ID','School Name','Location Name','Image Filename','Active','Conference Name','Sub-Conference Name'],<br />
 colModel: [<br />
 {name:'SCH_ID',index:'SCH_ID',key:true,hidden:true},<br />
 {name:'SCH_NAME',index:'SCH_NAME',sorttype:'text',resizable:true},<br />
 {name:'SCH_LOCATION_NAME',index:'SCH_LOCATION_NAME',sorttype:'text',resizable:true},<br />
 {name:'SCH_IMAGEFILENAME',index:'SCH_IMAGEFILENAME',sorttype:'text',resizable:true},<br />
 {name:'SCH_ACTIVE',index:'SCH_ACTIVE',width:60,align:'center',stype:'select',sorttype:'numeric',editable:true,edittype:'checkbox',search:true,formatter:'checkbox',resizable:false,<br />
 editoptions: {<br />
 value: "1:Yes;0:No"<br />
 },<br />
 searchoptions: {<br />
 sopt:['eq'],<br />
 value: ":All;1:Yes;0:No",<br />
 defaultValue: "1"<br />
 }},<br />
 {name:'CONFERENCENAME',index:'CONFERENCENAME',sorttype:'text',editable:false,resizable:true},<br />
 {name:'SUBCONFERENCENAME',index:'SUBCONFERENCENAME',sorttype:'text',editable:false,resizable:true}<br />
 ],<br />
 prmNames:{page:"pageIndex",sort:"sortCol",order:"sortDir",rows:"pageSize"},<br />
 postData:{method:"GetSchools",returnFormat:"JSON"},<br />
 datatype: populateGrid,<br />
 jsonReader: {<br />
 id: "SCH_ID",<br />
 root: function(obj){return obj.DATA.DATA;},<br />
 page: "pageIndex",<br />
 total: function(obj){return parseInt(obj.pageCount);},<br />
 records: function(obj){return parseInt(obj.recordCount);},<br />
 cell:""<br />
 }<br />
 });</p>
<p> grid.jqGrid('navGrid','#ptoolbar',{del:false,add:false,edit:false,search:false});<br />
 grid.jqGrid('filterToolbar',{stringResult:true,searchOnEnter:false});<br />
 });</p>
]]></description>
        	        	<pubDate>Fri, 01 Aug 2014 19:21:50 +0300</pubDate>
        </item>
</channel>
</rss>