<?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: Best way to edit data from different tables?</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables</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/best-way-to-edit-data-from-different-tables/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on Best way to edit data from different tables?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21679</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21679</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You are in the wrong forum.</p>
<p>Please post your problem here:</p>
<p><a href="http://www.trirand.net/forum/" rel="nofollow" target="_blank">http://www.trirand.net/forum/</a></p>
</p>
<p>This place is for the open source Java Script only jqGrid, while you try the commetial jqGrid PHP component.</p>
</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 14 Jan 2011 19:05:29 +0200</pubDate>
        </item>
        <item>
        	<title>rob-t on Best way to edit data from different tables?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21677</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21677</guid>
        	        	<description><![CDATA[<p>There are a lot of threads in the help forum with no replies...</p>
</p>
<p>Is anyone supporting jqGrid?&#160; Is the author/team still around?&#160;</p>
</p>
<p>I&#39;m not going to pay $300 for something that can&#39;t edit data from more than one table and has no support whatsoever... has anyone been able to get this to work?&#160; How did you do it?</p>
]]></description>
        	        	<pubDate>Fri, 14 Jan 2011 18:16:21 +0200</pubDate>
        </item>
        <item>
        	<title>rob-t on Best way to edit data from different tables?</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21618</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/best-way-to-edit-data-from-different-tables#p21618</guid>
        	        	<description><![CDATA[<p>I love jqGrid so far, but I am totally stuck.&#160; I can&#39;t figure out how to edit data from multiple tables.&#160; I have gone over every line of every tutorial, and I&#39;m starting to think that it&#39;s just not possible. </p>
<ul>
<li>I have downloaded and installed the application from here: jqGrid for PHP 3.8.2.1 <a rel="nofollow" href="http://www.trirand.net/download.aspx" target="_blank">http://www.trirand.net/download.aspx</a></li>
<li>I have read through and tried both of these methods: <em>Master Detail On Select</em> and <em>Sub Grid (2 nested levels)</em>.&#160; I am using these guides: <a rel="nofollow" href="http://www.trirand.net/demophp.aspx" target="_blank">http://www.trirand.net/demophp.aspx</a> and <a rel="nofollow" href="http://www.trirand.net/documentation/php/index.htm" target="_blank"></a><a href="http://www.trirand.net/documen" rel="nofollow" target="_blank">http://www.trirand.net/documen</a>...../index.htm</li>
</ul>
<p>This is the problem:&#160; I can&#39;t seem to get anything to work, because in the first table ("users"), I have a primary key "uid", but in the second table that I also need to be able to edit, "profiles", I do not have that same primary key.&#160; So I have to do a complex SQL select command that uses a third table as an intermediary (the "node" table):</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2856' value='Select Code' data-codeid='sfcode2856' /></p>
<div class='sfcode' id='sfcode2856'>$grid-&#62;SelectCommand = &#39;SELECT a.uid, a.name, b.firm, b.city,  b.state, a.mail, b.paidmembershipdate, b.firmcategory FROM users a,  profiles b, node c WHERE a.uid=c.uid AND c.nid=b.nid&#39;;</div>
<p>However, if I set up editing in jqGrid, it only can post the updates to the "users" table, since that is the table is chosen for editing in grid.php ($grid-&#62;table = &#39;users&#39;;) and that table has the primary key (uid).&#160; Any other changes are NOT saved to the database.</p>
</p>
<p>Currently, I have a Master/Detail layout set up, with the Master grid displaying data from the "users" table, and the Detail grid displaying data from the "profiles" table.&#160; However, this ALSO has to rely on a complex SELECT command in "detail.php", and it doesn&#39;t work - the detail table is blank unless I remove the last AND statement, in which case it displays all records, not the one that I select in the Master table.</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8541' value='Select Code' data-codeid='sfcode8541' /></p>
<div class='sfcode' id='sfcode8541'>$grid-&#62;SelectCommand = &#34;SELECT a.uid, a.name, b.firm, b.city, b.state, a.mail, b.paidmembershipdate, b.firmcategory FROM users a, profiles b, node c WHERE a.uid=c.uid AND c.nid=b.nid AND uid= ?&#34;;</div>
<p>Am I going about this all wrong?&#160; Can I edit two tables from the same grid?&#160; If not, can I do it with a SubGrid or a Master/Detail setup?&#160; Am I required to have the same primary key in both tables to do anything at all?</p>
</p>
<p>Please help, I will have to abandon this project and jqGrid in general if no one has any ideas on how to do this.&#160; (You would think this would be easy.) <img class="spSmiley" style="margin:0" title="Cry" src="/blog/wp-content/forum-smileys/sf-cry.gif" alt="Cry" /></p>
]]></description>
        	        	<pubDate>Tue, 11 Jan 2011 02:03:21 +0200</pubDate>
        </item>
</channel>
</rss>