<?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: Grid as SubGrid - beforeShowForm - Set Value</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value</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/grid-as-subgrid-beforeshowform-set-value/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3308</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3308</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>One&#160; possible solution for your problem IMHO is to close all opened</p>
<p>subgrids and and then to open only one for editing and other operation.</p>
<p>Currently you can not do this. I have make some little changes so</p>
<p>that this can be done and will be available in the next release.</p>
<p>The little piece of code that would resolve your problem can look like this:</p>
<p>var minuses = table.find("img[src$=minus.gif]").each(function() {</p>
<p>$(this).parents("td").eq(0).click();</p>
<p>});</p>
<p>You should call this in subgrid row expanded event, but should wait</p>
<p>until the next release.</p>
</p>
<p>Regards</p>
<p>Tony</p>
<p>to use</p>
]]></description>
        	        	<pubDate>Thu, 27 Nov 2008 03:23:35 +0200</pubDate>
        </item>
        <item>
        	<title>Barry on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3292</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3292</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>Foreign Key Index - The key that linkes a master - a <em>foreign key</em> is a referential constraint between two tables. Its the key that makes a master-detail relationship.</p>
<p>Add button... both the master table and the detail table has an add button on the bottom of the grid. The problem is with the detail table (sub grid). The sub grid needs to know the FK of the master table . The subgrid needs to know which row is the master. I am currently doing that by setting the selected row and then getting the value from the selected row. That works until the user clicks on another row.</p>
<p>Barry</p>
]]></description>
        	        	<pubDate>Wed, 26 Nov 2008 07:31:46 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3278</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3278</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Sorry but It is difficult to understand.</p>
<p>What is FK index?</p>
<p>Where is your add button? Where the user click to add&#160; - in master</p>
<p>or in detail?</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Wed, 26 Nov 2008 01:06:20 +0200</pubDate>
        </item>
        <item>
        	<title>Barry on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3259</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3259</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>SubGrid as Grid configuration (Master-Detail):</p>
<p>I set the row to selected on expand. When I click add to open the modal add dialog the FK index is correctly set in the Add Form.</p>
<p><strong>Here is a problem.</strong> The user can select another row in the master grid. If the user selects another row then the add form dialog wil contain the FK value from the new (currently) selected row.</p>
<p>What the SubGrid needs to know is the ID of the row that caused it to open. Have you considered this? Is there a built in solution?</p>
<p>Thanks!</p>
<p>Barry</p>
]]></description>
        	        	<pubDate>Tue, 25 Nov 2008 07:46:48 +0200</pubDate>
        </item>
        <item>
        	<title>Barry on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3227</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3227</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>That makes sense!. I was thinking that since the row was not selected in the exampe that there might be a way of getting the row if it was not selected.</p>
<p>For my project, in this case, it is correct to select the row. I suppose that in trees expand and select node are distinct operations often. In a grid it probably the case that select on expand is almost always correct.</p>
<p>Thanks for you help on this!</p>
<p>Barry</p>
]]></description>
        	        	<pubDate>Mon, 24 Nov 2008 08:40:49 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3214</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3214</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I suppose you use grid as subgrid</p>
<p>When you open the subgrid in subGridRowExpanded the</p>
<p>second parameter is the id of the row - then</p>
<p>subGridRowExpanded : function (sub_id, row_id) {</p>
<p>...</p>
<p>$("#mygrid").setSelection(row_id);</p>
<p>...</p>
<p>}</p>
<p>This will select your row.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 24 Nov 2008 01:05:09 +0200</pubDate>
        </item>
        <item>
        	<title>Barry on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3206</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3206</guid>
        	        	<description><![CDATA[<p>Ok, I figured out how to set the $ID_1 value in the form!</p>
<p><span class="sfcode">beforeShowForm : function(form_id)<br />{<br />&#160; jQuery("#ID_1",form_id).attr("value","999");<br />}</span></p>
<p>So how do I get the value of ID_1 from the parent row if its not selected?</p>
]]></description>
        	        	<pubDate>Sat, 22 Nov 2008 20:24:46 +0200</pubDate>
        </item>
        <item>
        	<title>Barry on Grid as SubGrid - beforeShowForm - Set Value</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3203</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value#p3203</guid>
        	        	<description><![CDATA[<p>Great job on jqgrid. The more I learn the more I like! I&#39;ve got my reads and edits working great. Trying to iron our the add controls.</p>
<p>In the parent grid I have a key column "ID_1". It is a FK of the child grid.</p>
<p>I click on the + button and the child grid and all the fields are correctly displayed.</p>
<p>I am using the navGrid Add button.</p>
<p>I&#39;ve been reading the forums for hours and haven&#39;t found an example. I found comments and instructions for accessing a selected row in the parent grid, but since I clicked on the + button, the parent row is NOT selected.</p>
<p>When the ADD form is created I want to insert the value of ID_1 from the parent row.</p>
<p>I don&#39;t know how to access the value from the parent grids row.</p>
<p>I don&#39;t know how to set this value in the ADD form.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8573' value='Select Code' data-codeid='sfcode8573' /></p>
<div class='sfcode' id='sfcode8573'>beforeShowForm : function(form_id){<br />&#160; alert(&#39;beforeShowForm&#39;);<br />&#160; alert(jQuery("#grid1").getGridParam("selrow"));//is null<br />&#160; alert("Key from parent row ID_1 = : " + "???");<br />&#160; form_id.SetValue("ID_1",???);<br />},&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;</div>
<p>Thanks</p></p>
]]></description>
        	        	<pubDate>Sat, 22 Nov 2008 09:40:19 +0200</pubDate>
        </item>
</channel>
</rss>