<?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: Need help with dynamically generating grid colModel and editoptions</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/need-help-with-dynamically-generating-grid-colmodel-and-editoptions</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/need-help-with-dynamically-generating-grid-colmodel-and-editoptions/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>paul.artist-geek on Need help with dynamically generating grid colModel and editoptions</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/need-help-with-dynamically-generating-grid-colmodel-and-editoptions#p27320</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/need-help-with-dynamically-generating-grid-colmodel-and-editoptions#p27320</guid>
        	        	<description><![CDATA[<p>For our application we need to generate scores of different types of grids for a wide application of views. &#160;Some edit, some are simple selectors, some need field validation and extention, some do not. &#160;Our server controller layer generates an xml definition of the view for a given grid need.</p>
<p>A given column looks like this.</p>
<p>&#60;STATUS width="100" editable="true" edittype="select"&#62;Status&#60;/STATUS&#62;</p>
<p>The php on the server renders this as a json string which is encoded in the client via<br />ColModel = JSON.parse(returnArr[1]); <br />ColNames = JSON.parse(returnArr[0]);&#160;<br />(the return array contains both the colModel, and the ColName so we can do it one server request).</p>
<p>I&#39;ve tried feeding the editoptions in, in various ways.</p>
<p>&#60;STATUS width="100" editable="true" edittype="select" editoptions="{value:&#39;Live:Pending&#39;}"&#62;Status&#60;/STATUS&#62;</p>
<pre class="code javascript">Which renders a valid json string, but the options don&#39;t show up.  I&#39;ve tried switching the quotes around so the values are encased in double quotes. (the legal json syntax)<br />&#160;If I do that the json parse fails.  I&#39;ve tried doing string replacement on the single quotes surrounding the options (parse fails again).<br /><br />I&#39;m not finding good examples on simply adding the editoptions post-load.  I can set other json switches I can read in the string to allow this if I have to.<br /><br />Another solution would be to feed the colModel and header directly with XML since our technology spits out whatever sort of xml view we need to start with.<br />&#160;</pre>
<p>&#160;</p>
]]></description>
        	        	<pubDate>Thu, 13 Sep 2012 16:58:33 +0300</pubDate>
        </item>
</channel>
</rss>