<?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: URGENT - PHP generated javascript fails</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/urgent-php-generated-javascript-fails</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/urgent-php-generated-javascript-fails/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>paulbhartzog on URGENT - PHP generated javascript fails</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/urgent-php-generated-javascript-fails#p24791</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/urgent-php-generated-javascript-fails#p24791</guid>
        	        	<description><![CDATA[<p>And yet this PHP works:</p>
</p>
<pre>$columns = "
{name:&#39;id&#39;, index:&#39;id&#39;, editable:false,},
{name:&#39;role&#39;, index:&#39;role&#39;, editable:true, editoptions:{size:20}},
";
echo $columns;
</pre>
</p>
<p>If I can&#39;t generate the javascript then I am going to have to hand-code a page for every table, which is not kewl at all. :-/</p>
]]></description>
        	        	<pubDate>Sun, 02 Oct 2011 07:58:07 +0300</pubDate>
        </item>
        <item>
        	<title>paulbhartzog on URGENT - PHP generated javascript fails</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/urgent-php-generated-javascript-fails#p24790</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/urgent-php-generated-javascript-fails#p24790</guid>
        	        	<description><![CDATA[</p>
<p>Totally baffled by this.</p>
</p>
<p>If I type in the javascript it works, but if I use PHP on the server-side to generate the exact same javascript, then the table still displays but the popup window when you click &#39;Edit&#39; has no fields.</p>
<p>Here&#39;s an example:</p>
</p>
<pre>colModel :[
{name:&#39;id&#39;, index:&#39;id&#39;, editable:false,},
{name:&#39;role&#39;, index:&#39;role&#39;, editable:true, editoptions:{size:20}},
], 
</pre>
</p>
<p>but if I generate that code with something like this:</p>
</p>
<pre>foreach($fields as $field){
	$column = "";
	$column .= "{";
	$column .= "name:&#39;" . $field . "&#39;,";
	$column .= "index:&#39;" . $field . "&#39;,";
	if($field == "id"){
		$column .= "editable:&#39;false&#39;,";
	} else {
		$column .= "editable:&#39;true&#39;,";
		$column .= "editoptions:{size:20}";
	}
	$column .= "},";
	echo $column;
	$columns .= $column;
}
</pre>
</p>
<p>then the table still displays but the popup window when you click &#39;Edit&#39; has no fields.</p>
<p>Why?</p>
]]></description>
        	        	<pubDate>Sun, 02 Oct 2011 07:50:48 +0300</pubDate>
        </item>
</channel>
</rss>