<?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: jqdata not displaying data</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data</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/jqdata-not-displaying-data/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Zandar on jqdata not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11619</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11619</guid>
        	        	<description><![CDATA[<p>I&#39;m struggling with editing the grid with the "editurl" paramater using PHP.</p>
<p>Could you please post your edit code?</p>
]]></description>
        	        	<pubDate>Sat, 07 Nov 2009 02:43:20 +0200</pubDate>
        </item>
        <item>
        	<title>ploppy on jqdata not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11332</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11332</guid>
        	        	<description><![CDATA[<p>thanks for reply tony.&#160; often helps if json is enabled on the server 🙂 many thanks</p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 15:57:52 +0200</pubDate>
        </item>
        <item>
        	<title>tony on jqdata not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11311</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11311</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Using FireBug &#8211; do you see&#160; the data returned from server?</p>
<p>If the grid is empty this means</p>
<p>1. No data is returned from server</p>
<p>2. If the data is returned it can not be accepted from jqGrid becouse of bad configuration</p>
<p>Regards</p>
<p>Tony</p>
<p>I have just noted.</p>
<p>Remove this from php code:</p>
<p>...</p>
<p>echo &#8220;&#60;pre&#62;&#8221;;<br />var_dump($responce);<br />echo &#8220;&#60;/pre&#62;&#8221;;</p>
</p>
<p>...</p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 08:43:36 +0200</pubDate>
        </item>
        <item>
        	<title>ploppy on jqdata not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11310</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11310</guid>
        	        	<description><![CDATA[<p>any chance of any help with this please? many thanks</p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 08:38:58 +0200</pubDate>
        </item>
        <item>
        	<title>ploppy on jqdata not displaying data</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11273</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqdata-not-displaying-data#p11273</guid>
        	        	<description><![CDATA[<p>hi</p>
<p>i am trying to get a tutorial on jqgrid from ... and i can add data but it is not displaying any data in the grid from the database. the grid is just blank. i would be grateful if someone could look over the code and show me where i am going wrong.</p>
</p>
<p>index.html</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3351' value='Select Code' data-codeid='sfcode3351' /></p>
<div class='sfcode' id='sfcode3351'>
<p>&#60;!DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.1//EN&#34;</p>
</p>
<p>&#34;<a href=&#34;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#038;quot; target=&#34;_blank&#34; target="_blank"></a><a href="http://www.w3.org/TR/xhtml11/D&#038;hellip" rel="nofollow" target="_blank"><a href="http://www.w3.org/TR/xhtml11/D" rel="nofollow">http://www.w3.org/TR/xhtml11/D</a>.....038;hellip</a>;..html11.dtd&#34;&#62;</p>
<p>&#60;html xmlns=&#34;<a href=&#34;<a href="http://www.w3.org/1999/xhtml&#038;quot" rel="nofollow" target="_blank">http://www.w3.org/1999/xhtml&#038;quot</a>; target=&#34;_blank&#34; target="_blank"><a href="http://www.w3.org/1999/xhtml" rel="nofollow" target="_blank">http://www.w3.org/1999/xhtml</a>&#34; xml:lang=&#34;en&#34;&#62;</p>
<p>&#60;head&#62;<br />&#60;/head&#62;</p>
<p>&#60;body&#62;<br />&#60;div class=&#34;wrapper&#34;&#62;<br />&#60;img src=&#34;logo.jpg&#34; alt=&#34;jQuery grid plugin&#34; /&#62;</p>
<p>&#60;h2&#62;JQGrid&#60;/h2&#62;<br />&#60;p&#62;JQGrid is &#60;del&#62;a free&#60;/del&#62; the best plugin for organizing tabulated or grid data using jQuery, made by Tony Tomov. Owing to a bit of difficulty getting concrete working examples of the grid that can work just out of a package, here is one for your use. Inside you&#39;ll find a static JSON file that can give you a good idea of how to start.&#60;/p&#62;</p>
<p>&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/jquery-ui-1.7.2.custom.css&#34; /&#62;</p>
<p>&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/all.css&#34; /&#62;<br />&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/ui.jqgrid.css&#34; /&#62;<br />&#60;link rel=&#34;stylesheet&#34; type=&#34;text/css&#34; media=&#34;screen&#34; href=&#34;css/jquery.searchFilter.css&#34; /&#62;</p>
<p>&#60;script src=&#34;js/jquery.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#60;script src=&#34;js/jquery-ui-1.7.2.custom.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#60;script src=&#34;js/i18n/grid.locale-en.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;<br />&#60;script src=&#34;js/jquery.jqGrid.min.js&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62;</p>
<p>&#60;table&#62; Filter by:<br />&#60;tr&#62;&#60;td&#62;Title&#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;search_title&#34; onkeydown=&#34;doSearch(arguments[0]&#124;&#124;event)&#34; /&#62;&#60;/td&#62;&#60;/tr&#62; <br />&#60;tr&#62;&#60;td&#62;Director&#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;search_director&#34; onkeydown=&#34;doSearch(arguments[0]&#124;&#124;event)&#34; /&#62;&#60;/td&#62;&#60;/tr&#62; <br />&#60;tr&#62;&#60;td&#62;Year&#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;search_year&#34; onkeydown=&#34;doSearch(arguments[0]&#124;&#124;event)&#34; /&#62;&#60;/td&#62;&#60;/tr&#62; <br />&#60;tr&#62;&#60;td&#62;Bond&#60;/td&#62;&#60;td&#62;&#60;input type=&#34;text&#34; id=&#34;search_bond&#34; onkeydown=&#34;doSearch(arguments[0]&#124;&#124;event)&#34; /&#62;&#60;/td&#62;&#60;/tr&#62; <br />&#160;<br />&#60;/table&#62; <br />&#60;table id=&#34;list2&#8243; class=&#34;scroll&#34; cellpadding=&#34;0&#8243; cellspacing=&#34;0&#8243;&#62;&#60;/table&#62;<br />&#60;div id=&#34;pager2&#8243; class=&#34;scroll&#34; style=&#34;text-align:center;&#34;&#62;&#60;/div&#62; <br />&#60;br /&#62;<br />&#60;a href=&#34;javascript:void(0)&#34; id=&#34;m1&#8243;&#62;Get selected row IDs&#60;/a&#62; &#60;br /&#62;<br />&#60;a href=&#34;javascript:void(0)&#34; id=&#34;m2&#8243;&#62;Add or edit a row&#60;/a&#62; <br />&#60;hr /&#62;</p>
<p>&#60;script type=&#34;text/javascript&#34;&#62;</p>
<p>// When you want to select certain rows<br />jQuery(&#34;#m1&#8243;).click(function() {<br />&#160;var s;<br />&#160;s = jQuery(&#34;#list2&#8243;).getGridParam(&#39;selarrrow&#39;);<br />&#160;alert(&#39;The selected rows are: &#39; + s);<br />});</p>
<p>jQuery(&#34;#m2&#8243;).click(function(){ <br />var gr = jQuery(&#34;#list2&#8243;).getGridParam(&#39;selrow&#39;); <br />if( gr != null ) {<br />jQuery(&#34;#list2&#8243;).editGridRow(gr,{height:280,reloadAfterSubmit:false}); <br />}<br />else {<br />jQuery(&#34;#list2&#8243;).editGridRow(&#34;new&#34;,{height:280,reloadAfterSubmit:false});<br />}<br />});</p>
<p>// This is the actual grid<br />jQuery(&#34;#list2&#8243;).jqGrid({<br />&#160;&#160;&#160; <a href=&#34;/blog/&#39;json.php&#39;&#34; target=&#34;_blank&#34; target="_blank">url:&#39;json.php&#39;</a>,<br />&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160; width:500,<br />&#160;&#160;&#160; height:&#39;auto&#39;,<br />&#160;&#160;&#160; colNames:[&#39;ID&#39;,&#39;Title&#39;,&#39;Director&#39;, &#39;Year&#39;, &#39;Bond&#39;,&#39;Budget&#39;],<br />&#160;&#160;&#160; colModel:[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;id&#39;,index:&#39;id&#39;, width:50, editable:false},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;title&#39;,index:&#39;title&#39;, width:120, editable:true, editoptions:{size:10}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;director&#39;,index:&#39;director&#39;, width:95, editable:true, editoptions:{size:10}},<br />&#160;&#160;&#160; &#160;{name:&#39;year&#39;,index:&#39;year&#39;, width:60, editable:true, editoptions:{size:10}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;bond&#39;,index:&#39;bond&#39;, width:90, align:&#34;right&#34;, editable:true, editoptions:{size:10}},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;budget&#39;,index:&#39;budget&#39;, width:60, align:&#34;right&#34;, editable:true, editoptions:{size:10}}&#160;&#160;<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; pager: jQuery(&#39;#pager2&#39;),<br />&#160;&#160;&#160; rowNum:7,<br />&#160;&#160;&#160; rowList:[10,20,30],<br />&#160;&#160;&#160; imgpath: &#39;themes/sand/images&#39;,<br />&#160;&#160;&#160; sortname: &#39;year&#39;,<br />&#160;&#160; &#160;mtype: &#39;POST&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; sortorder: &#39;desc&#39;,<br />&#160;&#160;&#160; loadonce: false, <br />&#160;multiselect: true, <br />&#160;editurl: &#39;edit.php&#39;,<br />&#160;&#160;&#160; caption: &#34;James Bond movies&#34;<br />});</p>
<p>&#160;&#160;&#160; // jqGrid Form tune&#160;&#160;&#160; <br />&#160;&#160;&#160; jQuery.jgrid.edit = {<br />&#160;&#160;&#160; addCaption: &#34;Add Record&#34;,<br />&#160;&#160;&#160; editCaption: &#34;Edit Record&#34;,<br />&#160;&#160;&#160; bSubmit: &#34;Submit&#34;,<br />&#160;closeAfterAdd: true,<br />&#160;&#160;&#160; bCancel: &#34;Cancel&#34;,&#160;&#160;&#160; <br />&#160;&#160;&#160; msg: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; required:&#34;Field is required&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; number:&#34;Please enter valid number&#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; minValue:&#34;value must be greater than or equal to &#34;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; maxValue:&#34;value must be less than or equal to&#34;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160; processData: &#34;Processing&#8230;&#34;,<br />&#160;&#160;&#160; editData:{myname:&#34;myvalue&#34;},<br />&#160;height:100,<br />&#160;&#160;&#160; top:0,<br />&#160;&#160;&#160; left:0&#160;&#160; <br />&#160;&#160;&#160;&#160; };</p>
</p>
<p>var timeoutHnd;<br />var flAuto = true;</p>
<p>// Live search<br />function doSearch(ev){<br />&#160;if(timeoutHnd) {<br />&#160;&#160;clearTimeout(timeoutHnd); }<br />&#160;timeoutHnd = setTimeout(gridReload,500);<br />}</p>
<p>// Send the data and refresh the grid<br />function gridReload(){<br />&#160;var title_mask = jQuery(&#34;#search_title&#34;).val();<br />&#160;var director_mask = jQuery(&#34;#search_director&#34;).val();<br />&#160;var year_mask = jQuery(&#34;#search_year&#34;).val();<br />&#160;var bond_mask = jQuery(&#34;#search_bond&#34;).val();<br />&#160;jQuery(&#34;#list2&#8243;).setGridParam({url:&#34;json.php?title_mask=&#34;+title_mask+&#34;&#38;director_mask=&#34;+director_mask+&#34;&#38;year_mask=&#34;+year_mask+&#34;&#38;bond_mask=&#34;+bond_mask,page:1}).trigger(&#34;reloadGrid&#34;);<br />}</p>
<p>&#60;/script&#62;<br />&#60;/div&#62;<br />&#60;/body&#62;<br />&#60;/html&#62;</p>
</div>
<p>json.php</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6382' value='Select Code' data-codeid='sfcode6382' /></p>
<div class='sfcode' id='sfcode6382'>
<p>&#60;?php</p>
<p>$page = $_POST[&#39;page&#39;]; // get the requested page <br />$limit = $_POST[&#39;rows&#39;]; // get how many rows we want to have into the grid <br />$sidx = $_POST[&#39;sidx&#39;]; // get index row &#8211; i.e. user click to sort <br />$sord = $_POST[&#39;sord&#39;]; // get the direction <br />$searchField = $_POST[&#39;searchField&#39;];<br />$searchString = $_POST[&#39;searchString&#39;];</p>
<p>if(!$sidx) $sidx =1; // connect to the database</p>
<p>if(isset($_GET[&#34;title_mask&#34;])) $title_mask = $_GET[&#39;title_mask&#39;]; <br />else $title_mask = &#34;&#34;; <br />if(isset($_GET[&#34;director_mask&#34;])) $director_mask = $_GET[&#39;director_mask&#39;]; <br />else $director_mask = &#34;&#34;; <br />if(isset($_GET[&#34;year_mask&#34;])) $year_mask = $_GET[&#39;year_mask&#39;]; <br />else $year_mask = &#34;&#34;; <br />if(isset($_GET[&#34;bond_mask&#34;])) $bond_mask = $_GET[&#39;bond_mask&#39;]; <br />else $bond_mask = &#34;&#34;;</p>
<p>$dbhost = &#34;localhost&#34;; // Add your data here<br />$dbuser = &#34;jqgrid_peterc&#34;; // Add your data here<br />$dbpassword = &#34;xxxxxx&#34;; // Add your data here<br />$database = &#34;jqgrid&#34;; // Add your data here<br />$db = mysql_connect($dbhost, $dbuser, $dbpassword) or die(&#34;Connection Error: &#34; . mysql_error()); <br />mysql_select_db($database) or die(&#34;Error conecting to db.&#34;);</p>
<p>//construct where clause <br />$where = &#34;WHERE 1=1&#8243;; <br />if($title_mask!=&#39;&#39;) $where.= &#34; AND title LIKE &#39;$title_mask%&#39;&#34;; <br />if($director_mask!=&#39;&#39;) $where.= &#34; AND director LIKE &#39;$director_mask%&#39;&#34;;&#160; <br />if($year_mask!=&#39;&#39;) $where.= &#34; AND year LIKE &#39;$year_mask%&#39;&#34;;&#160; <br />if($bond_mask!=&#39;&#39;) $where.= &#34; AND bond LIKE &#39;$bond_mask%&#39;&#34;;</p>
<p>$result = mysql_query(&#34;SELECT COUNT(*) AS total FROM jqgrid &#34;.$where) or die( mysql_error() ); <br />$row = mysql_fetch_array($result,MYSQL_ASSOC);</p>
<p>$count = $row[&#39;count&#39;]; <br />if( $count &#62;0 ) { $total_pages = ceil($count/$limit); } else { $total_pages = 0; } <br />if ($page &#62; $total_pages) $page=$total_pages; <br />$start = $limit*$page &#8211; $limit; // do not put $limit*($page &#8211; 1)</p>
<p>$SQL = &#34;SELECT id, title, director, director, year, bond, budget FROM jqgrid &#34;.$where.&#34; ORDER BY $sidx $sord LIMIT $start , $limit&#34;;&#160;</p>
<p>$result = mysql_query( $SQL ) or die(&#34;Couldn&#39;t execute query.&#34;.mysql_error());</p>
<p>$responce-&#62;page = $page; <br />$responce-&#62;total = $total_pages; <br />$responce-&#62;records = $count; <br />$i=0; while($row = mysql_fetch_array($result,MYSQL_ASSOC)) { <br />$responce-&#62;rows[$i][&#39;id&#39;]=$row[id]; <br />$responce-&#62;rows[$i][&#39;cell&#39;]=array($row[id],$row[title],$row[director],$row[year],$row[bond],$row[budget]); $i++; } <br />echo &#34;&#60;pre&#62;&#34;;<br />var_dump($responce);<br />echo &#34;&#60;/pre&#62;&#34;;<br />echo json_encode($responce); <br />mysql_close($db); <br />?&#62;</p>
</div>
<p>i haven&#39;t attached the edit file because that is working ok and also there is a staic json file which i haven&#39;t included. i have tried to debug using var_dump but nothing is being output. i have tried both localhost with wamp and on my linux server. other db apps are working fine. many thanks</p>
]]></description>
        	        	<pubDate>Fri, 30 Oct 2009 05:24:53 +0200</pubDate>
        </item>
</channel>
</rss>