<?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: Requesting Guidance on Master Detail Grid scenario</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario</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/requesting-guidance-on-master-detail-grid-scenario/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>newperson on Requesting Guidance on Master Detail Grid scenario</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13884</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13884</guid>
        	        	<description><![CDATA[<p>I figured this problem out after closing my eyes and thinking real hard for 3 minutes. I am not sure anyone else will need this information but I am going to share it just in case</p>
</p>
<p><strong>php</strong></p>
</p>
<p>$responce-&#62;rows[$i][&#39;id&#39;]=$row[computer_name].$row[record];</p>
</p>
<p>the db column computer_name exists in other tables in my db design and this column isn&#39;t unique on this particular table so I needed to use an autoincrementing column in this case record and concatenate it to the computer_name becoming one string, thus becoming a unique number!</p>
</p>
<p><strong>javascript</strong></p>
</p>
<p>&#160;onSelectRow: function(ids) {<br />&#160;if(ids == null &#38;&#38; ids != ids)<br />&#160;{<br />&#160;&#160;&#160;ids=0;<br />&#160;&#160;&#160;if($(&#8221;#masterSubGrid&#8221;).jqGrid(&#39;getGridParam&#39;,&#39;records&#39;) &#62;0 )<br />&#160;&#160;&#160;{<br />&#160;&#160;&#160;$(&#8221;#masterSubGrid&#8221;).jqGrid(&#39;setGridParam&#39;,{url:&#8221;store_master_detail_subgrid.php?q=1&#38;id=&#8221;+ids.substring(0,4),page:1});<br />&#160;&#160;&#160;$(&#8221;#masterSubGrid&#8221;).jqGrid(&#39;setCaption&#39;,&#8221;Viewing Compuuters for Store: &#8220;+ids.substring(0,4))<br />&#160;&#160;&#160;.trigger(&#39;reloadGrid&#39;);<br />&#160;&#160;&#160;}<br />&#160;&#160;} else {<br />&#160;&#160;&#160;$(&#8221;#masterSubGrid&#8221;).jqGrid(&#39;setGridParam&#39;,{url:&#8221;store_master_detail_subgrid.php?q=1&#38;id=&#8221;+ids.substring(0,4),page:1});<br />&#160;&#160;&#160;$(&#8221;#masterSubGrid&#8221;).jqGrid(&#39;setCaption&#39;,&#8221;Viewing Computers for Store: &#8220;+ids.substring(0,4))<br />&#160;&#160;&#160;.trigger(&#39;reloadGrid&#39;);<br />&#160;&#160;}<br />&#160;}</p>
</p>
<p>and substring to save the day, since I don&#39;t really care about all the information contained in id I need to use substring to extract the exact information I need which happens to be the first 4 characters. because I made it the first 4 characters in my php code $row[computer_name].$row[record];</p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 09:03:27 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on Requesting Guidance on Master Detail Grid scenario</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13883</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13883</guid>
        	        	<description><![CDATA[<p>Any ideas?<img class="spSmiley" style="margin:0" title="Cool" src="/blog/wp-content/forum-smileys/sf-cool.gif" alt="Cool" /></p>
]]></description>
        	        	<pubDate>Thu, 14 Jan 2010 06:43:48 +0200</pubDate>
        </item>
        <item>
        	<title>newperson on Requesting Guidance on Master Detail Grid scenario</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13835</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/requesting-guidance-on-master-detail-grid-scenario#p13835</guid>
        	        	<description><![CDATA[<p>I am trying to follow the demo @ <a href="http://trirand.com/blog/jqgrid/jqgrid.html" rel="nofollow" target="_blank"><a href="http://trirand.com/blog/jqgrid" rel="nofollow">http://trirand.com/blog/jqgrid</a>.....qgrid.html</a> Advanced &#62; Master Detail which is basically has a Main grid and when you click on a row on the Master Grid a subgrid is populated with data about that id.</p>
<p>The data I have in my primary grid is somewhat of a log of computers, and these computers repeat themselves numerous times. I have other tables in my db that share other specific computer information that I&#39;d like to display on the subgrid but the problem I am having is that the example demonstrates how to do this with the id record, and as you may know the id records needs to be unique. Unfortunately the unique id of the table that populates the primary grid is unique to that table. How can I go about populating the subgrid with data in this scenario?</p>
</p>
<p>My thoughts are:</p>
<p>1. Using a js function onSelectRow to get a specific column in ColModel and set that as the id for the sub grid url.</p>
<p>2. Somehow approach this at the database level and somehow perform a join on two tables using unique data on table 1 to join with table 2. I don&#39;t know how this could be done though.</p>
]]></description>
        	        	<pubDate>Wed, 13 Jan 2010 17:35:39 +0200</pubDate>
        </item>
</channel>
</rss>