<?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: Problem with navigator search</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search</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/problem-with-navigator-search/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>gexhi on Problem with navigator search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23849</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23849</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I am having same problem as Jiggazzzzs first problem, when I click the find button it returns all table records.</p>
</p>
<p>my code is:</p>
</p>
<p>javascript:</p>
<p>&#60;?php // no direct access<br />defined( &#39;_JEXEC&#39; ) or die( &#39;Restricted access&#39; );?&#62;<br />&#60;?php<br />&#160;&#160;&#160; $myfirstgridpath=JURI::root().&#39;modules/mod_Nderprerje/&#39;;<br />&#160;&#160; &#160;<br />&#160;&#160;&#160; $document =&#38; JFactory::getDocument();<br />&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; $document-&#62;addStyleSheet($myfirstgridpath.&#39;css/ui-lightness/jquery-ui-1.7.2.custom.css&#39;);<br />&#160;&#160;&#160; $document-&#62;addStyleSheet($myfirstgridpath.&#39;css/ui.jqgrid.css&#39;);<br />&#160;&#160; &#160; &#160;<br />&#160;&#160;&#160; $document-&#62;addScript($myfirstgridpath.&#39;js/jquery-1.4.2.min.js&#39;);<br />&#160;&#160;&#160; $document-&#62;addScript($myfirstgridpath.&#39;js/i18n/grid.locale-en.js&#39;);<br />&#160;&#160;&#160; $document-&#62;addScript($myfirstgridpath.&#39;js/jquery.jqGrid.min.js&#39;);</p>
<p>?&#62;</p>
<p>&#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160; jQuery.noConflict();</p>
<p>&#160;&#160;&#160; jQuery(document).ready(function(){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#list").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url:&#39;&#60;?php echo $myfirstgridpath.&#39;/datasource.php&#39;;?&#62;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: "xml",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; mtype:&#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames:[&#39;ID&#39;,&#39;Emri&#39;,&#39;Kontrata&#39;, &#39;Data&#39;, &#39;Debia&#39;,&#39;Tipi&#39;,&#39;Zona&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel:[{name:&#39;ID&#39;,index:&#39;ID&#39;, width:50},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;EMER_DEBITORI&#39;,index:&#39;EMER_DEBITORI&#39;, width:100},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;NR_CONT&#39;,index:&#39;NR_CONT&#39;, width:60},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;Joomla_Date_Shkeputje&#39;,index:&#39;Joomla_Date_Shkeputje&#39;, width:110},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;DEBIA_TOTALE&#39;,index:&#39;DEBIA_TOTALE&#39;, width:80, align:"right"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;TIP_DESC&#39;,index:&#39;TIP_DESC&#39;, width:70, align:"right"},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;EMER_ZONE&#39;,index:&#39;EMER_ZONE&#39;, width:80,align:"right"}],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum:10,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; loadonce:false,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; autowidth:true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList:[10,20,30,100],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;ID&#39;,<br />&#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; sortorder: "ASC",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption:"Lista e Debitoreve te nderprere",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; loadtext:"Ne kerkim, ju lutem prisni",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; toolbar:[true,"top"]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#list").jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,{edit:false,add:false,del:false});</p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;&#160; });</p>
<p>&#60;/script&#62;</p>
<p>&#60;table id="list" class="search"&#62;&#60;/table&#62;<br />&#60;div id="pager" class="search" style="text-align:center;"&#62;&#60;/div&#62;</p>
</p>
<p>and PHP:</p>
<p>&#60;?php<br />//defined(&#39;_JEXEC&#39;,1) or die(&#39;Restricted access&#39;);<br />//defined( &#39;_VALID_MOS&#39; ) or die( &#39;Restricted access&#39; );</p>
<p>//$host&#160;&#160; &#160;&#160;&#160; &#160;= trim( $params-&#62;get( &#39;host&#39; ) );<br />//$database&#160;&#160; &#160;&#160;&#160; &#160;= trim( $params-&#62;get( &#39;database&#39; ) );<br />//$user&#160;&#160; &#160;&#160;&#160; &#160;= trim( $params-&#62;get( &#39;user&#39; ) );<br />//$password&#160;&#160; &#160;&#160;&#160; &#160;= trim( $params-&#62;get( &#39;password&#39; ) );</p>
<p>$host&#160;&#160;&#160;&#160; = &#39;host&#39;;<br />$user&#160;&#160;&#160;&#160; = &#39;xxxxxx&#39;;<br />$password = &#39;xxxxx&#39;;<br />$database = &#39;xxxxxx&#39;;</p>
<p>$page = $_GET[&#39;page&#39;]; // get the requested page<br />$limit= $_GET[&#39;rows&#39;]; // get how many rows we want to have into the grid<br />$sidx = $_GET[&#39;sidx&#39;]; // get index row - i.e. user click to sort<br />$sord = $_GET[&#39;sord&#39;]; // get the direction</p>
<p>if(!$sidx) $sidx =1;</p>
<p>//connect to the database<br />$db = mssql_connect($host, $user, $password) or die("Connection Error: " . mssql_error());<br />mssql_select_db($database) or die("Error conecting to db.");</p>
<p>$result = mssql_query("SELECT COUNT(*) AS count FROM [Joomla].[dbo].[DEBITOR_TE_SHKEPUTUR]");<br />$row = mssql_fetch_array($result,MSSQL_ASSOC);<br />$count = $row[&#39;count&#39;];<br />$plus1=&#39;1&#39;;</p>
<p>if( $count &#62;0 ) {<br />&#160;&#160;&#160; $totalpages = ceil($count/$limit);<br />&#160;&#160;&#160; } else {<br />&#160;&#160;&#160; $totalpages = 0;<br />&#160;&#160;&#160; }</p>
<p>if ($page &#62; $totalpages) $page=$totalpages;<br />$start = ($limit*$page - $limit);<br />$start1=$start+$plus1;<br />$next=$start+$limit; // do not put $limit*($page - 1)<br />$SQL = "SELECT * FROM (SELECT row_number() OVER (ORDER BY ".$sidx."&#160;&#160; ".$sord.") AS rownum ,ID,[EMER_DEBITORI],[NR_CONT] ,[Joomla_Date_Shkeputje],[DEBIA_TOTALE],[TIP_DESC],[EMER_ZONE] FROM [Joomla].[dbo].[DEBITOR_TE_SHKEPUTUR]) AS A<br />WHERE A.rownum BETWEEN ".$start1." and ".$next;<br />$result = mssql_query( $SQL ) or die("Couldn t execute query.".mssql_error());</p>
<p>if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {<br />&#160;&#160;&#160; header("Content-type: application/xhtml+xml;charset=utf-8");<br />&#160;&#160;&#160; } else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: text/xml;charset=utf-8");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; &#160;<br />&#160;&#160;&#160; $et = "&#62;";<br />&#160;&#160;&#160; echo "&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?$et\n";<br />&#160;&#160;&#160; echo "&#60;rows&#62;";<br />&#160;&#160;&#160; echo "&#60;page&#62;".$page."&#60;/page&#62;";<br />&#160;&#160;&#160; echo "&#60;total&#62;".$totalpages."&#60;/total&#62;";<br />&#160;&#160;&#160; echo "&#60;records&#62;".$count."&#60;/records&#62;";</p>
<p>&#160;&#160;&#160; // be sure to put text data in CDATA<br />&#160;&#160;&#160; while($row = mssql_fetch_array($result,MSSQL_ASSOC)) {<br />&#160;&#160; &#160;&#160;&#160; &#160;echo "&#60;row id=&#39;". $row[ID]."&#39;&#62;";<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;echo "&#60;cell&#62;". $row[ID]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[EMER_DEBITORI]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[NR_CONT]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //echo "&#60;cell&#62;". $row[name]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //&#160; echo "&#60;cell&#62;&#60;![CDATA[". $row[Joomla_Date_Shkeputje]."]]&#62;&#60;/cell&#62;";<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;echo "&#60;cell&#62;". $row[Joomla_Date_Shkeputje]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[DEBIA_TOTALE]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[TIP_DESC]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[EMER_ZONE]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160; //&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[note]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160; //&#160;&#160; echo "&#60;cell&#62;&#60;![CDATA[". $row[note]."]]&#62;&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;/row&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; echo "&#60;/rows&#62;";</p>
<p>&#160;&#160;&#160; mssql_close($db)</p>
<p>?&#62;</p>
</p>
<p>I can&#39;t find the problem, pleas a help will be great<img class="spSmiley" style="margin:0" title="Embarassed" src="/blog/wp-content/forum-smileys/sf-embarassed.gif" alt="Embarassed" /></p>
]]></description>
        	        	<pubDate>Mon, 04 Jul 2011 11:14:25 +0300</pubDate>
        </item>
        <item>
        	<title>r4raza on Problem with navigator search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23423</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23423</guid>
        	        	<description><![CDATA[<p>It seems like it is doing string search.</p>
]]></description>
        	        	<pubDate>Wed, 01 Jun 2011 22:34:40 +0300</pubDate>
        </item>
        <item>
        	<title>Jiggazzzzz on Problem with navigator search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23407</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23407</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p> no, my first problem is solved, it missed a &#39;loadonce: true&#39;. Now I have a new problem with the search: for example, when I search therows where the id is less than 5, the search returns results where the id is equal to 1,2,3,4, 10 and 11. You Have an idea?</p>
]]></description>
        	        	<pubDate>Tue, 31 May 2011 13:22:40 +0300</pubDate>
        </item>
        <item>
        	<title>yottza on Problem with navigator search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23405</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23405</guid>
        	        	<description><![CDATA[<p>Hi <strong>Jiggazzzzz <br />images is your ploblem?</strong></p>
<p><span style="text-decoration: underline;"></span><a href="http://www.picza.net/uppic/pic/2011_05_31/52c/52cbfb87e3b9a234a173e8417b0f7ed6.jpg"><img src="http://www.picza.net/uppic/pic/2011_05_31/52c/52cbfb87e3b9a234a173e8417b0f7ed6.jpg" width="100"  class="sfimageleft spUserImage" alt="" /><img src="http://www.trirand.com/blog/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png" class="sfimageleft sfmouseleft" alt="Image Enlarger" /></a></p>
]]></description>
        	        	<pubDate>Tue, 31 May 2011 12:46:06 +0300</pubDate>
        </item>
        <item>
        	<title>Jiggazzzzz on Problem with navigator search</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23397</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/problem-with-navigator-search#p23397</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p> please excuse my English, I&#39;m French and I use a translator.</p>
<p> I have a problem with navigator search.</p>
</p>
<p>When I click on the icon &#39;search&#39;, window &#39;search&#39; opens and I can take my data to my research.</p>
<p> But when I click the Find button, nothing happens. The window &#39;search&#39; remains open but nothing else, the rows of the grid correspond to all rows of my database.</p>
</p>
<p>This is my code :</p>
</p>
<p>HTML :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2635' value='Select Code' data-codeid='sfcode2635' /></p>
<div class='sfcode' id='sfcode2635'>&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.0 Transitional//EN&#34; &#34;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#34;&#038;gt" rel="nofollow" target="_blank"><a href="http://www.w3.org/TR/xhtml1/DT" rel="nofollow">http://www.w3.org/TR/xhtml1/DT</a>.....t;&#038;gt</a>;<br />&#60;html xmlns=&#34;<a href="http://www.w3.org/1999/xhtml&#038;quot" rel="nofollow" target="_blank">http://www.w3.org/1999/xhtml&#038;quot</a>; xml:lang=&#34;fr&#34; &#62;<br />&#160;&#160; &#160;&#60;head&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;title&#62;Back office - immovu.com&#60;/title&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=iso-8859-1&#34; /&#62;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/bo_style.css&#34; /&#62;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/excite-bike/jquery-ui-1.8.13.custom.css&#34; /&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/ui.jqgrid.css&#34; /&#62;<br />&#160;&#160; &#160;&#60;/head&#62;<br />&#160;&#160; &#160;&#60;body&#62;<br />&#160;&#160; &#160;&#60;?php include(&#39;inc_top_menu.php&#39;);?&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;div id=&#34;content&#34;&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;table id=&#34;list&#34;&#62;&#60;tr&#62;&#60;td/&#62;&#60;/tr&#62;&#60;/table&#62; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;div id=&#34;pager&#34;&#62;&#60;/div&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;!--&#60;input type=&#34;BUTTON&#34; id=&#34;bedata&#34; value=&#34;Editer&#34; /&#62;--&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#60;input type=&#34;BUTTON&#34; id=&#34;bddata&#34; value=&#34;Supprimer&#34; /&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;/div&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;script src=&#34;js/jquery-1.6.1.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;script src=&#34;js/jquery-1.5.2.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;script src=&#34;js/i18n/grid.locale-en.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;script src=&#34;js/jquery.jqGrid.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#60;script src=&#34;js/list.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#160;&#160; &#160;&#60;/body&#62;<br />&#60;/html&#62;</div>
</p>
<p>Javascript :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2724' value='Select Code' data-codeid='sfcode2724' /></p>
<div class='sfcode' id='sfcode2724'>jQuery(&#34;#list&#34;).jqGrid({<br />&#160;&#160; &#160;url:&#39;server.php&#39;,<br />&#160;&#160; &#160;datatype: &#39;xml&#39;,<br />&#160;&#160; &#160;mtype: &#39;POST&#39;,<br />&#160;&#160; &#160;colNames:[&#39;Inv No&#39;,&#39;Date&#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;invid&#39;, index:&#39;invid&#39;, width:55}, <br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;invdate&#39;, index:&#39;invdate&#39;, width:90, editable:true}, <br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;amount&#39;, index:&#39;amount&#39;, width:80, align:&#39;right&#39;, editable:true}, <br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;tax&#39;, index:&#39;tax&#39;, width:80, align:&#39;right&#39;, editable:true}, <br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;total&#39;, index:&#39;total&#39;, width:80, align:&#39;right&#39;, editable:true}, <br />&#160;&#160; &#160;&#160;&#160; &#160;{name:&#39;note&#39;, index:&#39;note&#39;, width:150, sortable:false, editable:true}<br />&#160;&#160; &#160;],<br />&#160;&#160; &#160;pager: &#39;#pager&#39;,<br />&#160;&#160; &#160;editurl: &#39;server.php&#39;,<br />&#160;&#160; &#160;rowNum:50,<br />&#160;&#160; &#160;rowList:[50,100,150],<br />&#160;&#160; &#160;sortname: &#39;invid&#39;,<br />&#160;&#160; &#160;sortorder: &#39;asc&#39;,<br />&#160;&#160; &#160;viewrecords: true,<br />&#160;&#160; &#160;gridview: true,<br />&#160;&#160; &#160;width: 1000, // largeur<br />&#160;&#160; &#160;height: &#34;100%&#34;, // hauteur<br />&#160;&#160; &#160;caption: &#39;Invheader :&#39;<br />});<br />jQuery(&#34;#list&#34;).jqGrid(&#39;navGrid&#39;,&#34;#pager&#34;,{add:false, del:false, edit:false, view:true},<br />{}, // edit<br />{}, // add<br />{}, // del<br />{multipleSearch: true}, // search<br />{} // view<br />);</div>
</p>
<p>And, PHP :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3902' value='Select Code' data-codeid='sfcode3902' /></p>
<div class='sfcode' id='sfcode3902'>&#60;?php </p>
<p>include(&#34;dbconfig.php&#34;);</p>
<p>$page = $_POST[&#39;page&#39;]; <br />$limit = $_POST[&#39;rows&#39;]; <br />$sidx = $_POST[&#39;sidx&#39;]; <br />$sord = $_POST[&#39;sord&#39;]; <br />&#160;<br />// if we not pass at first time index use the first column for the index or what you want<br />if(!$sidx) $sidx =1; <br />&#160;<br />// connect to the MySQL database server <br />$db = mysql_connect($dbhost, $dbuser, $dbpassword) or die(&#34;Connection Error: &#34; . mysql_error()); <br />&#160;<br />// select the database <br />mysql_select_db($database) or die(&#34;Error connecting to db.&#34;); <br />&#160;<br />// calculate the number of rows for the query. We need this for paging the result <br />$result = mysql_query(&#34;SELECT COUNT(*) AS count FROM invheader&#34;); <br />$row = mysql_fetch_array($result,MYSQL_ASSOC); <br />$count = $row[&#39;count&#39;]; <br />&#160;<br />// calculate the total pages for the query <br />if( $count &#62; 0 &#38;&#38; $limit &#62; 0) { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_pages = ceil($count/$limit); <br />} else { <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $total_pages = 0; <br />} <br />&#160;<br />// if for some reasons the requested page is greater than the total <br />// set the requested page to total page <br />if ($page &#62; $total_pages) $page=$total_pages;<br />&#160;<br />// calculate the starting position of the rows <br />$start = $limit*$page - $limit;<br />&#160;<br />// if for some reasons start position is negative set it to 0 <br />// typical case is that the user type 0 for the requested page <br />if($start &#60;0) $start = 0; <br />&#160;<br />// the actual query for the grid data <br />$SQL = &#34;SELECT invid, invdate, amount, tax, total, note FROM invheader ORDER BY $sidx $sord LIMIT $start , $limit&#34;; <br />$result = mysql_query( $SQL ) or die(&#34;Couldn&#39;t execute query.&#34;.mysql_error()); </p>
<p>// we should set the appropriate header information. Do not forget this.<br />header(&#34;Content-type: text/xml;charset=utf-8&#34;);<br />&#160;<br />$s = &#34;&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&#62;&#34;;<br />$s .=&#160; &#34;&#60;rows&#62;&#34;;<br />$s .= &#34;&#60;page&#62;&#34;.$page.&#34;&#60;/page&#62;&#34;;<br />$s .= &#34;&#60;total&#62;&#34;.$total_pages.&#34;&#60;/total&#62;&#34;;<br />$s .= &#34;&#60;records&#62;&#34;.$count.&#34;&#60;/records&#62;&#34;;<br />&#160;<br />// be sure to put text data in CDATA<br />while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {<br />&#160;&#160;&#160; $s .= &#34;&#60;row id=&#39;&#34;. $row[&#39;invid&#39;].&#34;&#39;&#62;&#34;;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#34;. $row[&#39;invid&#39;].&#34;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#34;. $row[&#39;invdate&#39;].&#34;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#34;. $row[&#39;amount&#39;].&#34;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#34;. $row[&#39;tax&#39;].&#34;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#34;. $row[&#39;total&#39;].&#34;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;cell&#62;&#60;![CDATA[&#34;. $row[&#39;note&#39;].&#34;]]&#62;&#60;/cell&#62;&#34;;<br />&#160;&#160;&#160; $s .= &#34;&#60;/row&#62;&#34;;<br />}<br />$s .= &#34;&#60;/rows&#62;&#34;; <br />&#160;<br />echo $s;<br />?&#62;</p>
</div>
<p>if you have an idea, let me know!</p>
]]></description>
        	        	<pubDate>Mon, 30 May 2011 18:06:51 +0300</pubDate>
        </item>
</channel>
</rss>