<?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: How data are handle ?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-data-are-handle</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/how-data-are-handle/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>bobhel on How data are handle ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-data-are-handle#p5921</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-data-are-handle#p5921</guid>
        	        	<description><![CDATA[<p>I have found my mistake ! I used Uppercase in the code as fallow :</p>
<p>jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; root: &#8220;ROWS&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; page: &#8220;PAGE&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; total: &#8220;total&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; records: &#8220;records&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; cell: &#8220;&#8221;,<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: &#8220;ID&#8221;<br />&#160;&#160;&#160; },</p>
<p>I have the previous code by rewriting using lowercase. Now, that looks working ..</p>
<p>Here you find the working code :</p>
</p>
<p>// We use a document ready jquery function.<br />jQuery(document).ready(function(){<br />gridimgpath = &#39;themes/sand/images&#39;;</p>
<p>jQuery("#list2").jqGrid({ <br />&#160;&#160;&#160; colNames:[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;], <br />&#160;&#160;&#160; colModel:[ <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;id&#39;,index:&#39;id&#39;, width:55}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:90}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;name&#39;,index:&#39;name asc, invdate&#39;, width:100}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;amount&#39;,index:&#39;amount&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;tax&#39;,index:&#39;tax&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;total&#39;,index:&#39;total&#39;, width:80,align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;note&#39;,index:&#39;note&#39;, width:150, sortable:false} ], <br />&#160;&#160;&#160; rowNum:10, <br />&#160;&#160;&#160; rowList:[10,20,30], <br />&#160;&#160;&#160; imgpath: gridimgpath, <br />&#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;), <br />&#160;&#160;&#160; sortname: &#39;id&#39;, <br />&#160;&#160;&#160; viewrecords: true, <br />&#160;&#160;&#160; sortorder: "desc", <br />&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; root: "rows",<br />&#160;&#160;&#160; &#160;&#160;&#160; page: "page",<br />&#160;&#160;&#160; &#160;&#160;&#160; total: "total",<br />&#160;&#160;&#160; &#160;&#160;&#160; records: "records",<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: "ID"<br />&#160;&#160;&#160; },//end jsonReader<br />&#160;&#160;&#160; caption:"JSON Example",<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; datatype : function(postdata) {<br />&#160;&#160;&#160;&#160;&#160; jQuery.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url:&#39;exemple.CFC?method=GetData2&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data:postdata,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType:"local",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;error: function(msg){ sDumper( "Error !: " + msg );},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; complete: function(postdata){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; // Update the data return by the server<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; responseText= [... personnal code to change data received from postdata.responseText ...]<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Trim the result<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; responseText=jQuery.trim(responseText);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var myjsongrid = eval("responseText");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var stuff = JSON.parse(myjsongrid);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var mygrid = jQuery("#list2")[0];<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Populate the grid <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery("#list2")[0].addJSONData(stuff);<br />&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //$("#list2")[0].addJSONData(JSON.parse(myjsongrid));<br />&#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; myjsongrid = null; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; responseText =null; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; stuff =null;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }// end complete<br />&#160;&#160;&#160;&#160;&#160; });// end ajax<br />&#160;&#160; },// end datatype<br />&#160;})// end jqgrid<br />}); // end ready<br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#60;/script&#62;</p></p>
]]></description>
        	        	<pubDate>Tue, 07 Apr 2009 16:52:47 +0300</pubDate>
        </item>
        <item>
        	<title>bobhel on How data are handle ?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-data-are-handle#p5918</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-data-are-handle#p5918</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I am new to jqGrid and I wonder how data are manage by the system.</p>
<p>I would like to know if jqGrid use the data return by the server and saved in the client cache (responseText) or if it use the Mydata provided to the addJSONData (e.g. mygrid.addJSONData(JSON.parse(Mydata )).</p>
<p>I will try to explain my problem better. Actually, I make an ajax call to get the data from a server (json) and that&#39;s working. But, I need to make some change in the data received before displaying them because they are not in the json format. Is it possible ? if yes, how can I do that, please ?</p>
<p>Actually, I succed to display a blank table with the pager almost well configured. I meand, everything is all right in the pager but the actual page is set to &#8220;0&#8243; instead of &#8220;1&#8243;.</p>
<p>I don&#39;t get error in firebug so things looks ok&#8230; So, I don&#39;t understand why that&#39;s not working.</p>
<p>Can anyone help me ?</p>
<p>Here my code :</p>
<p>// We use a document ready jquery function.<br />jQuery(document).ready(function(){<br />gridimgpath = &#39;themes/sand/images&#39;;</p>
<p>jQuery("#list2").jqGrid({ <br />&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; datatype : function(postdata) {<br />&#160;&#160;&#160;&#160;&#160; jQuery.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url:&#39;exemple.CFC?method=GetData&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data:postdata,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType:"any",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;error: function(msg){ sDumper( "Error !: " + msg );},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; complete: function(postdata){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; // Update the data return by the server<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; responseText=... my code to change data return from server ...<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Trim the result<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; responseText=jQuery.trim(responseText);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; var mygrid = jQuery("#list2")[0]; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; var myjsongrid = eval("responseText");<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; stuff = JSON.parse(myjsongrid);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; // Populate the grid <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; mygrid.addJSONData(stuff);<br />&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //$("#list2")[0].addJSONData(JSON.parse(myjsongrid));<br />&#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; myjsongrid = null; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; responseText =null; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; sDumper(stuff);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160; },</p>
<p>&#160;&#160;&#160; colNames:[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Client&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;], <br />&#160;&#160;&#160; colModel:[ <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;id&#39;,index:&#39;id&#39;, width:55}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;invdate&#39;,index:&#39;invdate&#39;, width:90}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;name&#39;,index:&#39;name asc, invdate&#39;, width:100}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;amount&#39;,index:&#39;amount&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;tax&#39;,index:&#39;tax&#39;, width:80, align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;total&#39;,index:&#39;total&#39;, width:80,align:"right"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;note&#39;,index:&#39;note&#39;, width:150, sortable:false} ], <br />&#160;&#160;&#160; rowNum:10, <br />&#160;&#160;&#160; rowList:[10,20,30], <br />&#160;&#160;&#160; imgpath: gridimgpath, <br />&#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;), <br />&#160;&#160;&#160; sortname: &#39;id&#39;, <br />&#160;&#160;&#160; viewrecords: true, <br />&#160;&#160;&#160; sortorder: "desc", <br />&#160;&#160;&#160; jsonReader: {<br />&#160;&#160;&#160; &#160;&#160;&#160; root: "ROWS",<br />&#160;&#160;&#160; &#160;&#160;&#160; page: "PAGE",<br />&#160;&#160;&#160; &#160;&#160;&#160; total: "total",<br />&#160;&#160;&#160; &#160;&#160;&#160; records: "records",<br />&#160;&#160;&#160; &#160;&#160;&#160; cell: "",<br />&#160;&#160;&#160; &#160;&#160;&#160; repeatitems: false,<br />&#160;&#160;&#160; &#160;&#160;&#160; id: "ID"<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; caption:"JSON Example" })<br />}); &#160;&#160;&#160; <br />&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#60;/script&#62;</p>
]]></description>
        	        	<pubDate>Tue, 07 Apr 2009 14:51:59 +0300</pubDate>
        </item>
</channel>
</rss>