<?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: How to get primary id of master row </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row</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/how-to-get-primary-id-of-master-row/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>finedesignz on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p7023</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p7023</guid>
        	        	<description><![CDATA[<p>I found my mistake:</p>
<p>Forgot to change from POST to GET when processing the data.</p>
<p>BUT IT WORKS!</p>
]]></description>
        	        	<pubDate>Wed, 03 Jun 2009 01:25:20 +0300</pubDate>
        </item>
        <item>
        	<title>finedesignz on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p7022</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p7022</guid>
        	        	<description><![CDATA[<blockquote></blockquote>
<p>Hi Tony,</p>
<p>I am trying to get the same result as this post.&#160; Here&#39;s my code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1604' value='Select Code' data-codeid='sfcode1604' /></p>
<div class='sfcode' id='sfcode1604'>// Begin Detail grid</p>
<p>&#160; $(&#8221;#list_detail&#8221;).jqGrid({<br />&#160;&#160;&#160; &#160; height: 100,<br />&#160;&#160;&#160; &#160; width:851,<br />&#160;&#160;&#160; &#160; url:&#39;data/subgrid.php?q=1&#38;id=0&#39;,<br />&#160;&#160;&#160; &#160; datatype: &#8220;xml&#8221;,<br />&#160;&#160;&#160;&#160;&#160; mtype: &#8220;GET&#8221;,<br />&#160;&#160;&#160; &#160; colModel:[<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;user_id&#39;,index:&#39;user_id&#39;, label:&#39;User&#39;, align:&#39;center&#39;, hidden:true, edittype:&#8221;text&#8221;, editrules:{number:true}, width:180, editable:true, editoptions:{readonly:true, size:30}},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;app&#39;,index:&#39;app&#39;, label:&#39;Application&#39;, width:200, align:&#39;center&#39;, editable:true, edittype:&#8221;select&#8221;,&#8230;&#8230;&#8230;.</p>
</div>
<p><input type='button' class='sfcodeselect' name='sfselectit3628' value='Select Code' data-codeid='sfcode3628' /></p>
<div class='sfcode' id='sfcode3628'>.navGrid(&#39;#pager_detail&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {add:true,edit:true,del:true,search:false}, //options<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {height:200,width:600,reloadAfterSubmit:true,url:&#39;licenseedit.php&#39;,closeAfterEdit:true}, // edit options<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {height:200,width:600,reloadAfterSubmit:false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; beforeShowForm: function(formid) {<br />// we should get the id of the master here<br />var uid = jQuery(&#8221;#list&#8221;).getGridParam(&#39;selrow&#39;);<br />if (uid != null ) {<br />// now we can set it in editurl<br />jQuery(&#8221;#list_detail&#8221;).setGridParam({editurl:&#39;licenseedit.php?user_id=&#39;+uid});<br />}<br />else alert(&#8221;Its not working again&#8221;)<br />}}, // add options<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {reloadAfterSubmit:false,url:&#39;licenseedit.php&#39;}, // del options<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {width:600} // search options<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; );<br />});</div>
<p>Firebug is showing this:</p>
<p>Nothing is being sent for the user_id, which should be the &#8220;selrow&#8221; value, correct?</p>
<table class="netInfoPostTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="netInfoParamName">app</td>
<td class="netInfoParamValue">
<pre>1</pre>
</td>
</tr>
<tr>
<td class="netInfoParamName">expiration</td>
<td class="netInfoParamValue">
<pre>2010-06-06</pre>
</td>
</tr>
<tr>
<td class="netInfoParamName">id</td>
<td class="netInfoParamValue">
<pre>_empty</pre>
</td>
</tr>
<tr>
<td class="netInfoParamName">oper</td>
<td class="netInfoParamValue">
<pre>add</pre>
</td>
</tr>
<tr>
<td class="netInfoParamName">user_id</td>
<td class="netInfoParamValue"></td>
</tr>
</tbody>
</table>
<p>I know you get many requests for help, but any help is greatly appreciated.</p>
]]></description>
        	        	<pubDate>Wed, 03 Jun 2009 00:33:45 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p996</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p996</guid>
        	        	<description><![CDATA[<p>If I understand right you use booth form edit and inline edit for one grid.</p>
<p>In editRow and saveRow methods there is a parameter url. Use this parameter for these methods.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 07 Jul 2008 00:31:02 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p991</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p991</guid>
        	        	<description><![CDATA[<p>Wonderful!! This works great with add option.</p>
<p>But Tony thers one problem now. I have put the beforeshowform function</p>
<p>as you told me. But now after adding a row, the editurl changes</p>
<p>permanently to editurl:&#8221;myurlhere.php?masterid=&#8221;+mid});</p>
<p>I need it to point to edit function url when im inline editing. But now what</p>
<p>happens is once I add a row, &#38; then if I try to inline edit a row,</p>
<p>the url remains the url for adding the row.</p>
]]></description>
        	        	<pubDate>Sun, 06 Jul 2008 04:35:00 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p969</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p969</guid>
        	        	<description><![CDATA[<p>Ok.</p>
<p>I recommend you to use a editurl option. Let suppose that the master grid has master id and detail has a detail id, then (in your case) you can use</p>
<p>a beforeShowForm event (3.2 version) to do that</p>
</p>
<p>Here is a piece of code:</p>
<p>jQuery("#detail").jqGrid({...}).navGrid("#pgdetail",{...},</p>
<p>{...}, //edit</p>
<p>{...</p>
<p>beforeShowForm: function(formid) {</p>
<p>// we should get the id of the master here</p>
<p>mid = jQuery("#master").getGridParam("selrow");</p>
<p>if (mid != null ) {</p>
<p>// now we can set it in editurl</p>
<p>jQuery("#detail").setGridParam({editurl:"myurlhere.php?masterid="+mid});</p>
<p>}</p>
<p>}</p>
<p>....</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 01 Jul 2008 09:41:15 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p968</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p968</guid>
        	        	<description><![CDATA[<p>I checkd out all the results for "master" in your forum.</p>
<p>even thgis one <a href="http://www.trirand.com/blog/?page_id=18/help/master-detail-grid-passing-parameters-from-master-to-detail/page-1&#038;value=master%25251&#038;search=1" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/?p" rel="nofollow">http://www.trirand.com/blog/?p</a>.....8;search=1</a></p>
<p>But sadly enough, I have not found the solution for implementing it</p>
<p>in the navgrid. I am using navgrid &#38; my navgrid does not take the</p>
<p>master grid id as one of the parameters for the add new option.</p>
<p>It would be great if you could help. Thanks for the cooperation.</p>
]]></description>
        	        	<pubDate>Tue, 01 Jul 2008 05:48:56 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p935</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p935</guid>
        	        	<description><![CDATA[<p>Search this forum with word "master" and you can find the solution</p>
]]></description>
        	        	<pubDate>Mon, 30 Jun 2008 03:13:35 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p929</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p929</guid>
        	        	<description><![CDATA[<p>All I want to do is simply add a row in the detail grid having bankID stored in the database equal to the id of the parent grid. So that the account is</p>
<p>linked to that bank (accounts are shown in the detail grid). But I am not</p>
<p>able to pass the parent grid id through the navgrid add option to the php script.</p>
]]></description>
        	        	<pubDate>Sun, 29 Jun 2008 04:14:01 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p928</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p928</guid>
        	        	<description><![CDATA[<p>My edit function in inline editing seems to work fine.</p>
<p>But I need to add a row when I click on the add record icon on the</p>
<p>navgrid. that is when I dont get the master id of the parent grid to pass.</p>
<p>here is the code for the navgrid of details grid :</p>
<p>jQuery("#list10_d").navGrid(&#39;#pager10_d&#39;, {}, //options<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; {height:180,width:400,reloadAfterSubmit:false, modal:true,<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; editCaption: &#39;Edit Account Details&#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;&#160;&#160;&#160;&#160; bSubmit: &#39;Save&#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;&#160;&#160;&#160;&#160; closeAfterEdit : true<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; }, // edit options<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; {height:180,width:400,reloadAfterSubmit:false, modal:true,<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; url: &#39;/test/public/account/addaccount?bankID=&#39;+bankID+&#39;&#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;&#160;&#160;&#160; bSubmit: &#39;Save&#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;&#160;&#160;&#160; addCaption: &#39;Add Account&#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;&#160;&#160;&#160; closeAfterAdd : true&#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;&#160; }, // add options<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; {url: &#39;/test/public/account/deleteaccount&#39;}, // del options<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; {} // search options<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; );</p>
<p>Now bankID is the id i store the parent id in, when I select a row in the parent grid.</p>
<p>But somehow the bankID alwasy come out to be 0 ie. the initial value I have given it.<br />I am assigning the value of bank ID to id when onselectrow is called.</p></p>
]]></description>
        	        	<pubDate>Sun, 29 Jun 2008 03:46:56 +0300</pubDate>
        </item>
        <item>
        	<title>reignchile on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p927</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p927</guid>
        	        	<description><![CDATA[<p><span style="font-family: Bitstream Vera Sans;"><span style="font-size: 10pt;"><strong>setGridParam({url:newvalue})</strong></span></span></p>
]]></description>
        	        	<pubDate>Sat, 28 Jun 2008 02:51:35 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p926</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p926</guid>
        	        	<description><![CDATA[<p>Mayank,</p>
<p>setUrl does not exist in 3.2 there are replacement methods for this.</p>
<p>Refer to Documantation how to upgrade</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 28 Jun 2008 02:00:47 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p925</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p925</guid>
        	        	<description><![CDATA[<p>I am getting error setURL is not a function after I have upgraded to 3.2rc.</p>
<p>I have setURL option in the onselectrow.</p>
<p>Can you please give me an example of what you are saying, as the current code doesnt seem to work for 3.2rc.</p>
<p>Thanks,</p>
<p>Mayank</p>
]]></description>
        	        	<pubDate>Sat, 28 Jun 2008 01:37:40 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p883</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p883</guid>
        	        	<description><![CDATA[<p>If you use 3.1 veresion please switch to 3.2rc. There is a bug when setting the url dynamically. You should do something like this.</p>
<p>Select the master id. After the master id is selected change the editurl of the detail to appropriate way.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Tue, 24 Jun 2008 11:44:52 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p882</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p882</guid>
        	        	<description><![CDATA[<p>also if i spearately alert the value of</p>
<p>the getgridparam value it works &#38; gives me the</p>
<p>value of the selected row in master grid</p>
]]></description>
        	        	<pubDate>Tue, 24 Jun 2008 11:12:24 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p881</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p881</guid>
        	        	<description><![CDATA[<p>I am trying to pass parameter of master grid id in the navigator of detail grid.</p>
<p>So when I click on the add icon of navigator of detail grid &#38; save a row it should call the below URL passing the parameter in the url (ie. id of master grid)</p>
<p>url: &#39;/test/public/account/addaccount?bankID=&#39;+jQuery("#list").getGridParam("selrow")</p>
<p>But instead the value is null. ie. the url is always /test/public/account/addaccount?bankID=null that is being called.</p>
<p>Please help. Am I trying the right thing.</p>
]]></description>
        	        	<pubDate>Tue, 24 Jun 2008 11:11:04 +0300</pubDate>
        </item>
        <item>
        	<title>tony on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p852</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p852</guid>
        	        	<description><![CDATA[<p>if "master" is the id for the table you can do</p>
<p>$("master").getGridParam("selrow"); to get the selected id row of the master</p>
<p>Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Sun, 22 Jun 2008 03:00:42 +0300</pubDate>
        </item>
        <item>
        	<title>mbhramar on How to get primary id of master row </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p846</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/how-to-get-primary-id-of-master-row#p846</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I am using Master Detail grid. I have a column in the detail grid that is a foreign key to the primary key of the master grid.</p>
<p>eg. i have id in banks table. &#38; banks_id in the accounts table.</p>
<p>Now I need to add a record in the detail table of accounts ( master grid conatins banks). But to add a record uder the currently selected bank I need to retrieve the current selected bank&#39;s id as I have to insert the row with the id of the bank selected in column banks_id.</p>
<p>How to get the id bank(master) selected in details grid(detail).</p>
<p>Pls help. Thanks.</p>
]]></description>
        	        	<pubDate>Sat, 21 Jun 2008 02:05:19 +0300</pubDate>
        </item>
</channel>
</rss>