<?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: beforeShowForm  event.... </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event</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/beforeshowform-event/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23080</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23080</guid>
        	        	<description><![CDATA[<p>How you can see from my status for example I am not a developer of jqGrid and not a moderator of the forum. I answer relative many question here and on the stackoverflow about the jqGrid. Nevertherless I have not enough time to create demos on demand. I have to make my main projects to earn&#160;money which we all need.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Mon, 09 May 2011 09:47:35 +0300</pubDate>
        </item>
        <item>
        	<title>aylawrence on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23078</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23078</guid>
        	        	<description><![CDATA[<p>please am totally confused, can you like demonstrate it with an example. using one of the demos on this site so i can understand it clearly and implement. am really confused for now...</p>
<p>thank</p>
]]></description>
        	        	<pubDate>Mon, 09 May 2011 01:14:35 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23077</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23077</guid>
        	        	<description><![CDATA[<p>I agree that the thread describes very close problems as which you have. If I would wrote my personal opinion (suggestion) in the thread I would suggest just to save the id of the last selected row of the master grid in a variable. Then if the user click on the "Add" button of the "child" grid you will get the FK id (<strong>brotherid&#160;</strong>in your case) from the variable.</p>
<p>One more possibility is more native. If the user select a row in the master grid your should set the parameter of the URL from the child grid to get the corresponding data and trigger "reloadGrid". I would set postData to postData: {brotherid: parentId} in the child grid before reloaging of the grid. So the parentId will be already saved somewhere in the parameters of the child grid and you can get the value any time when you as need.</p>
<p>I am sure that you will solve the problem.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sun, 08 May 2011 23:52:23 +0300</pubDate>
        </item>
        <item>
        	<title>aylawrence on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23076</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23076</guid>
        	        	<description><![CDATA[<p>Hello, I really appreciate your desire to help me.&#160;</p>
<p>what i want have been described in the following llink but i &#160;don&#39;t understand.. so please the following threads in&#160;</p>
</p>
<p>/blog/?page_id=393/help/grid-as-subgrid-beforeshowform-set-value/</p>
<p>Please check out for me ...</p>
]]></description>
        	        	<pubDate>Sun, 08 May 2011 22:44:26 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23066</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23066</guid>
        	        	<description><![CDATA[<p>Hello!</p>
<p>I asked you to post your current JavaScript code. Why you don&#39;t post it?</p>
<p>From the information which you posted it is not clear <em>how</em> you determine the <strong>changebrotherid</strong> on click of Add button of the changeprovince&#160;grid. Probably you display more as one grid on the page and get id of the selected row of the another grid (the grid with brothers). From the information which you posted it is still unclear why it would be interesting&#160;for the user to see the <strong>changebrotherid</strong> or any other id. It could be interesting only for the server. If the changeprovince grid has hidden <strong>changebrotherid</strong>&#160;field you can add some additional properties (see <a href="http://stackoverflow.com/questions/3176157/sending-additional-parameters-to-editurl-on-jqgrid/3177531#3177531" target="_blank">here</a>) to send the <strong>changebrotherid</strong>&#160;to the server. If&#160;<strong>changebrotherid</strong>&#160;field is not inside of the changeprovince grid you can modify the <strong>postdata</strong> parameter of <a href="/jqgridwiki/doku.php?id=wiki:form_editing#events" target="_blank">beforeSubmit</a>, use <a href="/jqgridwiki/doku.php?id=wiki:form_editing#properties" target="_blank">editData</a> paramer or use <a href="/jqgridwiki/doku.php?id=wiki:form_editing#events" target="_blank">serializeEditData</a> event handle.</p>
<p>So you have at least 4 possibility to send additional information to the server without to show any additional information to the user. The code used beforeShowForm, which you posted in your first post, shold aslo works if you use it corectly, but I need to see more code to say why your code fragment not work.</p>
<p>Your database design seems me also strange. Look at the table <strong>brother</strong> for example. It has <strong>brotherid</strong> column, which looks like id, but you use PRIMARY KEY (`id`) instead of PRIMARY KEY (`<strong>brotherid</strong>`). Then too many columns of the <strong>brother</strong>&#160;table you declare as nullable. At least <strong>Surname</strong> column and not only <strong>brotherid</strong> column should be declared with <strong>NOT NULL</strong>.</p>
<p>I don&#39;t know your original problem for which the database is created, but nevertheless the existence of the <strong>brother</strong>&#160;table seems me strange. I could more imagine <strong>person</strong> table having informations like Surname, BirthPlace and so on. The <strong>relative</strong> table whould include only two id refereces from the&#160;<strong>person</strong>&#160;table and the reference id from another <strong>level_of_relation</strong> table which assigns ids to relations like brother, husband, father&#160;and so on. In the case you will have less information duplicates and the information about brothers which is symmetric from the nature will be saved also in symmetric way.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sun, 08 May 2011 13:36:38 +0300</pubDate>
        </item>
        <item>
        	<title>aylawrence on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23053</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23053</guid>
        	        	<description><![CDATA[<p>ok let me explain this way to make you understand ok.&#160;</p>
<p>I this tables in the database:&#160;</p>
<p>CREATE TABLE `brother` (</p>
<p><span style="white-space:pre"> </span>`brotherid` int(11) NOT NULL AUTO_INCREMENT,</p>
<p><span style="white-space:pre"> </span>`BirthPlace` varchar(30) DEFAULT NULL,&#160;</p>
<p><span style="white-space:pre"> </span>`Surname` varchar(30) DEFAULT NULL,</p>
<p><span style="white-space:pre"> </span>`Situation` varchar(10) DEFAULT NULL,</p>
<p><span style="white-space:pre"> </span>&#160;`Nationality` varchar(30) DEFAULT NULL,&#160;</p>
<p><span style="white-space:pre"> </span>`Country` varchar(30) DEFAULT NULL,&#160;</p>
<p><span style="white-space:pre"> </span>`State` varchar(30) DEFAULT NULL,</p>
<p><span style="white-space:pre"> </span>)&#160;PRIMARY KEY (`id`)</p>
</p>
<p>CREATE TABLE `changeprovince` (</p>
<p><span style="white-space: pre;"> </span>`changeProvinceID` int(11) NOT NULL AUTO_INCREMENT,</p>
<p>&#160;<span style="white-space: pre;"> </span> `changebrotherid` int(11) DEFAULT NULL,&#160;</p>
<p><span style="white-space: pre;"> </span>`dateTwo` varchar(15) DEFAULT NULL,&#160;</p>
<p><span style="white-space: pre;"> </span>`toProvince` varchar(30) DEFAULT NULL,&#160;</p>
<p><span style="white-space: pre;"> </span>`dateOne` varchar(15) DEFAULT NULL,&#160;</p>
<p><span style="white-space: pre;"> </span>`fromProvince` varchar(30) DEFAULT NULL,</p>
<p><span style="white-space: pre;"> </span>PRIMARY KEY (`changeProvinceID`),</p>
<p><span style="white-space: pre;"> </span>&#160; KEY `FK_changeprovince` (`changebrotherid`),</p>
<p><span style="white-space: pre;"> </span>CONSTRAINT `FK_changeprovince` FOREIGN KEY (`changebrotherid`) REFERENCES `brother` (`brotherid`) ON DELETE CASCADE</p>
<p>)</p>
</p>
<p>I have about 4 other tables that references BROTHER table</p>
<p>CHANGEPROVINCE &#160;table have been displayed in a grid and is a child table having a forieng key which is a primary in the BROTHER table.&#160;</p>
</p>
<p><strong>Now my problem</strong></p>
<p>when a user clicks on the add button on the CHANGEPROVINCE grid.. the add dialog opens. i want to be able to fetch one of the &#160;<strong>changebrotherid </strong>fields &#160;and insert it into the changebrotherid field in the add dialog box before the users saves.&#160;</p>
</p>
<p>I if dont do this mysql will generate an error</p>
<p>thanks</p></p>
]]></description>
        	        	<pubDate>Sat, 07 May 2011 13:26:14 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23052</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23052</guid>
        	        	<description><![CDATA[<p>Sorry, but I still not really understand what you want. If you have some foreign keys in the grid the key can be known only for the <strong>existing</strong> rows. In case of "Add" dialog a new data item or items will be created (probably on the server) after the submitting. Moreover it is absolutely unclear for me why some additional information should be shown for the user in the "Add" dialog. I could understand, that some additional information <em>should be send to the server</em> together with the request to add new item or some additional information (not only the id of new item) will be <em>send back</em> inside the server response on the "add" operation.</p>
<p>In general if it is really needed to display information, one can of course add any additional information to the "Add" or "Edit" dialog. If the information, which need be displayed, are saved in the hidden column it can be implemented very easy. It can be that what you need can be just implemented by definition of <strong>defaultValue</strong> property in the <a href="/jqgridwiki/doku.php?id=wiki:common_rules#editoptions" target="_blank">editoptions</a>. I don&#39;t know. I have to few information.</p>
<p>The solution of the problem could be JavaScript code, but it is difficult to write something if you don&#39;t posted any code, if the column definitions are unknown, if it is not clear whether you implemented the grid as the local grid or as grid with datatype:&#39;json&#39; or &#39;xml&#39; and so on.</p>
<p>So if you don&#39;t want to spend your and my time <strong>you should describe the problem more full und clear and post the current JavaScript where the jqGrid is used</strong> and clear mark the places in the code which work not like you as need.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Sat, 07 May 2011 12:29:52 +0300</pubDate>
        </item>
        <item>
        	<title>aylawrence on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23049</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23049</guid>
        	        	<description><![CDATA[<blockquote>
<p>OlegK said:</p>
<p>The first problem is: what you want to achive? The second: do you placed the code on the correct place?&#160;You should better describe the problem which you has more clear and post more code.</p>
<p>Best regards<br />Oleg&#160;</p>
</blockquote>
<hr />
<p>Hello, thanks for the correction.. here is my problem and what i want..&#160;</p>
<p>I want that when a user clicks on the add button on the grid, i want to feed some of the feilds in the add diaglog box with values from the grid. &#160;grid is display information that have a foreign key, so it means if the user wants to add new data i have to save the foreign of the record too. I hope you will understand what am driving at.&#160;</p>
<p>Thanks a lot</p>
]]></description>
        	        	<pubDate>Fri, 06 May 2011 20:53:48 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23048</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23048</guid>
        	        	<description><![CDATA[<p>The first problem is: what you want to achive? The second: do you placed the code on the correct place?&#160;You should better describe the problem which you has more clear and post more code.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Fri, 06 May 2011 20:35:28 +0300</pubDate>
        </item>
        <item>
        	<title>aylawrence on beforeShowForm  event.... </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23047</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/beforeshowform-event#p23047</guid>
        	        	<description><![CDATA[<p>beforeShowForm : function(form_id)<br />{<br />&#160; jQuery("#ID_1&#8243;,form_id).attr("value","999&#8243;);<br />}</p>
</p>
<p>How do i get this code working?? Can sombody figure it out for me pleae</p>
]]></description>
        	        	<pubDate>Fri, 06 May 2011 19:42:52 +0300</pubDate>
        </item>
</channel>
</rss>