<?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: populate grid column in edit mode depending on another column</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/populate-grid-column-in-edit-mode-depending-on-another-column</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/populate-grid-column-in-edit-mode-depending-on-another-column/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>rmvenancio on populate grid column in edit mode depending on another column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/populate-grid-column-in-edit-mode-depending-on-another-column#p21315</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/populate-grid-column-in-edit-mode-depending-on-another-column#p21315</guid>
        	        	<description><![CDATA[<p>Karina,</p>
</p>
<p>In your group you should have something similar :</p>
</p>
<p>editoptions: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value: FunctionToGetTheInitialListofItems(),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataEvents: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { type: &#39;change&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fn: function (e) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var selected= $(e.target).val(); //Get the type of cooperation id<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var newvalues = FunctionToGetTheSecondDropDownValues(mtype).split(";"); // split the lines <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var DropDowncontructor= "";</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (newvalues!= "") {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; for (var i = 0; i &#60; tcoops.newvalues; i++) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var newvalues= newvalues[i].split(":");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; DropDowncontructor+= &#39;&#60;option value="&#39; + newvalues[0] + &#39;"&#62;&#39; + newvalues[1] + &#39;&#60;/option&#62;&#39;&#160; // the is the value and the ID</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#unit").html(DropDowncontructor);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
</p>
<p>This is not tested ... not 100% correct, but is very near that (maybe 95%).</p>
<p>Best regards,</p>
]]></description>
        	        	<pubDate>Thu, 16 Dec 2010 16:28:44 +0200</pubDate>
        </item>
        <item>
        	<title>karina on populate grid column in edit mode depending on another column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/populate-grid-column-in-edit-mode-depending-on-another-column#p21292</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/populate-grid-column-in-edit-mode-depending-on-another-column#p21292</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Given a grid with several columns, let&#39;s say first column contains groups, and second one a group&#39;s subunits (one-to-many relationship).</p>
<p>Now, in edit mode, I want second column to turn into a dropdown, and I want it to be populated depending on first column (to change a group&#39;s current unit, one can choose from a set of units which &#39;feed&#39; the drop-down, but this is not the whole set of units in database, but a subset depending on the group&#39;s id).</p>
<p>I have something like:</p>
<p>{</p>
<p>name: "group",</p>
<p>index: "group",</p>
<p>width: 100,</p>
<p>editable: false</p>
<p>},</p>
<p>{</p>
<p>name: "unit",</p>
<p>index: "unit",</p>
<p>width: 150,</p>
<p>editable: true,</p>
<p>edittype: "select",</p>
<p>editoptions: {</p>
<p>value: unitsForCurrentGroup</p>
<p>}</p>
<p>},</p>
</p>
<p>unitsForCurrentGroup is a javascript variable and grid is an inline grid.</p>
</p>
<p>I tried to use an onedit - oneditfunc - handler, which is indeed passed the edited row&#39;s id (which is equal to group id in my case) and that method returns a group&#39;s units and stores them in unitsForCurrentGroup.&#160;</p>
<p>Still no luck, in edit mode my drop down is empty (I suppose the value for editoptions must be known at grid loading time, not just when editing a row?)</p>
</p>
<p>Thanks,</p>
<p>Karina</p>
]]></description>
        	        	<pubDate>Wed, 15 Dec 2010 11:56:54 +0200</pubDate>
        </item>
</channel>
</rss>