<?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: Nothing happens</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/nothing-happens</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/nothing-happens/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>rodrigozeba on Nothing happens</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/nothing-happens#p6826</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/nothing-happens#p6826</guid>
        	        	<description><![CDATA[<p>I downloaded all files (jgrid and jgrid_demo) and followed the instructions. But I cound&#39;t make it work. Here my codes:</p>
<p>roteiros.html:</p>
<p>&#60;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&#62;<br />&#60;html xmlns="http://www.w3.org/1999/xhtml"&#62;<br />&#60;head&#62;<br />&#60;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&#62;<br />&#60;title&#62;Untitled Document&#60;/title&#62;<br />&#60;link rel="stylesheet" type="text/css" media="screen" href="jquery_plugins/jqGrid/themes/basic/grid.css" /&#62;<br />&#60;link rel="stylesheet" type="text/css" media="screen" href="jquery_plugins/jqGrid/themes/jqModal.css" /&#62;<br />&#60;script src="jquery/jquery.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#60;script src="jquery_plugins/jqGrid/jquery.jqGrid.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#60;script src="jquery_plugins/jqGrid/js/jqModal.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#60;script src="jquery_plugins/jqGrid/js/jqDnR.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#60;script type="text/javascript"&#62;<br />jQuery(document).ready(function(){ <br />&#160; jQuery("#list").jqGrid({<br />&#160;&#160;&#160; url:&#39;dados_roteiro.php&#39;,<br />&#160;&#160;&#160; datatype: &#39;xml&#39;,<br />&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160; colNames:[&#39;Chave&#39;,&#39;Titulo&#39;, &#39;Descricao&#39;,&#39;Data de Partida&#39;,&#39;Data de Retorno&#39;],<br />&#160;&#160;&#160; colModel :[ <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;rot_chave_primaria&#39;, index:&#39;rot_chave_primaria&#39;, width:55}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;rot_titulo&#39;, index:&#39;rot_titulo&#39;, width:90}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;rot_descricao&#39;, index:&#39;rot_descricao&#39;, width:80, align:&#39;right&#39;}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;rot_periodo_inicial&#39;, index:&#39;rot_periodo_inicial&#39;, width:80, align:&#39;right&#39;}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;rot_periodo_final&#39;, index:&#39;rot_periodo_final&#39;, width:80, align:&#39;right&#39;}, <br />&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160; rowNum:10,<br />&#160;&#160;&#160; rowList:[10,20,30],<br />&#160;&#160;&#160; sortname: &#39;Chave&#39;,<br />&#160;&#160;&#160; sortorder: "DESC",<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; imgpath: &#39;jquery_plugins/jqGrid/themes/basic/images&#39;,<br />&#160;&#160;&#160; caption: &#39;Roteiros Cadastrados&#39;<br />&#160; }); <br />}); <br />&#60;/script&#62;<br />&#60;/head&#62;</p>
<p>&#60;body&#62;<br />&#60;table id="list" class="scroll"&#62;<br />&#60;/table&#62;<br />&#60;div id="pager" class="scroll" style="text-align:center;"&#62; <br />&#60;/div&#62;</p>
<p>&#60;/body&#62;</p>
<p>&#60;/html</p>
<p>the xml:</p>
<p>&#60;?xml version="1.0" encoding="utf-8"?&#62;<br />&#60;rows&#62;<br />&#160; &#60;page&#62; &#60;/page&#62;<br />&#160; &#60;total&#62; &#60;/total&#62;<br />&#160; &#60;records&#62; &#60;/records&#62;<br />&#160;&#160;&#160; &#60;row id = "unique_rowid"&#62;<br />&#160;&#160;&#160;&#160;&#160; &#60;cell&#62; cellcontent &#60;/cell&#62;<br />&#160;&#160;&#160;&#160;&#160; &#60;cell&#62; &#60;![CDATA[&#60;font color="red"&#62;cell&#60;/font&#62; content]]&#62; &#60;/cell&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8230;<br />&#160;&#160;&#160; &#60;/row&#62;<br />&#160;&#160;&#160; &#60;row id = "unique_rowid"&#62;<br />&#160;&#160;&#160;&#160;&#160; &#60;cell&#62; cellcontent &#60;/cell&#62;<br />&#160;&#160;&#160;&#160;&#160; &#60;cell&#62; &#60;![CDATA[&#60;font color="red"&#62;cell&#60;/font&#62; content]]&#62; &#60;/cell&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#8230;<br />&#160;&#160;&#160; &#60;/row&#62;<br />&#160;&#160;&#160;&#160;&#160; &#8230;<br />&#60;/rows&#62;</p>
</p>
<p>and the php file (dados_roteiro.php):</p>
<p>&#60;?php<br />include ("functions.php");<br />conexao();<br />sessao();<br />?&#62;<br />&#60;?php</p>
<p>$page = $_GET[&#39;page&#39;]; </p>
<p>$limit = $_GET[&#39;rows&#39;]; </p>
<p>$sidx = $_GET[&#39;sidx&#39;]; </p>
<p>$sord = $_GET[&#39;sord&#39;]; </p>
<p>$result = mysql_query("SELECT COUNT(*) AS count FROM tur_roteiros"); <br />$row = mysql_fetch_array($result,MYSQL_ASSOC); <br />$count = $row[&#39;count&#39;]; </p>
<p>if( $count &#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 />} </p>
<p>if ($page &#62; $total_pages) $page=$total_pages;</p>
<p>$start = $limit*$page - $limit;</p>
<p>if($start &#60;0) $start = 0; </p>
<p>$SQL = "SELECT rot_chave_primaria, rot_titulo, rot_descricao, rot_valor, rot_periodo_inicial, rot_periodo_final FROM tur_roteiros ORDER BY \\"{$sidx}\\" \\"{$sord}\\" LIMIT 0 , 10"; <br />$result = mysql_query( $SQL ) or die("Couldn&#39;t execute query.".mysql_error()); </p>
<p>// we should set the appropriate header information<br />/*if ( stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml") ) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: application/xhtml+xml;charset=utf-8"); <br />} else {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; header("Content-type: text/xml;charset=utf-8");<br />}*/</p>
<p>echo "&#60;?xml version=&#39;1.0&#39; encoding=&#39;utf-8&#39;?&#62;";<br />echo "&#60;rows&#62;";<br />echo "&#60;page&#62;".$page."&#60;/page&#62;";<br />echo "&#60;total&#62;".$total_pages."&#60;/total&#62;";<br />echo "&#60;records&#62;".$count."&#60;/records&#62;";</p>
<p>while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {<br />echo "&#60;row id=&#39;". $row[&#39;rot_chave_primaria&#39;]."&#39;&#62;";&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[&#39;rot_titulo&#39;]."&#60;/cell&#62;";<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo "&#60;cell&#62;&#60;![CDATA[". $row[&#39;rot_descricao&#39;]."]]&#62;&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[&#39;rot_valor&#39;]."&#60;/cell&#62;";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; echo "&#60;cell&#62;". $row[&#39;rot_periodo_inicial&#39;]."&#60;/cell&#62;";<br />echo "&#60;/row&#62;";<br />}<br />echo "&#60;/rows&#62;";<br />?&#62;</p>
</p>
<p>Every time I load tthe roteiro.html page, I get a blue &#60;div&#62; with nothing inside. The jgrid_demo doesn&#39;t work either. How do the $_GET parameters are passed to the url (dados_roteiro.php)? How do I put it to work?</p>
</p>
<p>Thanks</p>
]]></description>
        	        	<pubDate>Wed, 20 May 2009 22:24:05 +0300</pubDate>
        </item>
</channel>
</rss>