<?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: Allow form edit to call dataUrl each time form is opened</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened</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/allow-form-edit-to-call-dataurl-each-time-form-is-opened/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jreisz on Allow form edit to call dataUrl each time form is opened</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21899</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21899</guid>
        	        	<description><![CDATA[<p>recreateForm: true by itself did not fix the issue for me, but setting the cache to false for all ajax requests fixed the issue for me:</p>
</p>
<p>.$.ajaxSetup({ cache: false });</p>
]]></description>
        	        	<pubDate>Mon, 31 Jan 2011 17:37:03 +0200</pubDate>
        </item>
        <item>
        	<title>jreisz on Allow form edit to call dataUrl each time form is opened</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21851</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21851</guid>
        	        	<description><![CDATA[<p>I thought this is working, but it is not after entering recreateForm: true.&#160; When I open the roles add form it shows the current list of entities and then I will close the roles add form.&#160; Then I will go to the entity grid and add another entity and then go back to the roles grid and open the add form and the newly added entity does not show up in the list and the server-side function Home/ListEntities is not called.&#160; What I am looking for is to have /Home/ListEntities called each time the add form is opened.</p>
<p>Thanks for your help.</p>
<p>Here is the code for the roles grid:</p>
<p>var lastSelRole;</p>
<p>var lastRoleRowData;</p>
<p>var roleRowCount;</p>
<p>$("#grdRoles").jqGrid({</p>
<p>url: &#39;/Home/GetPartnerRoles&#39;,</p>
<p>datatype: "json",</p>
<p>mtype: &#39;POST&#39;,</p>
<p>height: &#39;auto&#39;,</p>
<p>width: &#39;auto&#39;,</p>
<p>colNames: [&#39;EntityRoleId&#39;, &#39;Entity Name&#39;, &#39;Role&#39;, &#39;Partner&#39;, &#39;Relationship Lead&#39;, &#39;Status&#39;, &#39;Date Entered&#39;, &#39;Date Entered Orig&#39;, &#39;Entered By&#39;],</p>
<p>colModel: [</p>
<p>{ name: &#39;EntityRoleId&#39;, index: &#39;EntityRoleId&#39;, editable: false, hidden: true, key: true },</p>
<p>{ name: &#39;EntityName&#39;, index: &#39;EntityName&#39;, width: 150, editable: true, edittype: &#39;select&#39;, editoptions: { dataUrl: &#39;/Home/ListEntities&#39; } },</p>
<p>{ name: &#39;Role&#39;, index: &#39;Role&#39;, width: 250, editable: true, align: &#39;left&#39;, edittype: &#39;select&#39;, editoptions: { dataUrl: &#39;/Home/ListRoles&#39;} },</p>
<p>{ name: &#39;Partner&#39;, index: &#39;Partner&#39;, width: 150, editable: true },</p>
<p>{ name: &#39;RelationshipLead&#39;, index: &#39;RelationshipLead&#39;, width: 150, editable: true },</p>
<p>{ name: &#39;Status&#39;, index: &#39;Status&#39;, width: 80, editable: true, edittype: &#39;select&#39;, editoptions: { dataUrl: &#39;/Home/ListRiskEnumeration?groupName=Status&#39;} },</p>
<p>{ name: &#39;DateEntered&#39;, index: &#39;DateEntered&#39;, width: 100, editable: true, edittype: &#39;custom&#39;, editoptions: { custom_element: disabledInput, custom_value: elementValue} },</p>
<p>{ name: &#39;DateEnteredOrig&#39;, index: &#39;DateEnteredOrig&#39;, hidden: true, editable: true, editrules: { edithidden: true} },</p>
<p>{ name: &#39;EnteredBy&#39;, index: &#39;EnteredBy&#39;, width: 100, editable: true, edittype: &#39;custom&#39;, editoptions: { custom_element: disabledInput, custom_value: elementValue} }</p>
<p>],</p>
<p>rowNum: 10,</p>
<p>rowList: [10, 20, 30],</p>
<p>pager: &#39;#pgrRoles&#39;,</p>
<p>sortname: &#39;Role&#39;,</p>
<p>viewrecords: true,</p>
<p>sortorder: "desc",</p>
<p>onSelectRow: function (id) {</p>
<p>roleRowCount = $("#grdRoles").getGridParam("reccount");</p>
<p>if ((id &#38;&#38; id != lastSelRole) &#124;&#124; roleRowCount == 1) {</p>
<p>if (lastSelRole != null) {</p>
<p>var rowData = $("#grdRoles").jqGrid(&#39;getRowData&#39;, lastSelRole);</p>
<p>if (!ArraysEqual(lastRoleRowData, rowData)) {</p>
<p>$("#grdRoles").jqGrid(&#39;saveRow&#39;, lastSelRole);</p>
<p>} else {</p>
<p>$("#grdRoles").jqGrid(&#39;restoreRow&#39;, lastSelRole);</p>
<p>}</p>
<p>} else {</p>
<p>$("#grdRoles").jqGrid(&#39;restoreRow&#39;, lastSelRole);</p>
<p>}</p>
<p>$("#grdRoles").jqGrid(&#39;editRow&#39;, id, true, onRoleRowEdit, &#39;&#39;, &#39;/Home/SavePartnerRole&#39;, &#39;&#39;, &#39;&#39;, onRoleSaveError);</p>
<p>lastSelRole = id;</p>
<p>}</p>
<p>},</p>
<p>loadError: function (xhr, status, error) {</p>
<p>var obj = $.parseJSON(xhr.responseText);</p>
<p>$("#roleErrorLabel").css("display", "");</p>
<p>$("#roleError").html(obj.ErrorMessage);</p>
<p>},</p>
<p>errorTextFormat: function (data) {</p>
<p>if (data.responseText.substr(0, 6) == "&#60;html ") {</p>
<p>return $(data.responseText).html();</p>
<p>}</p>
<p>else {</p>
<p>var obj = $.parseJSON(data.responseText);</p>
<p>return obj.ErrorMessage;</p>
<p>}</p>
<p>},</p>
<p>editurl: &#39;/Home/SavePartnerRole&#39;,</p>
<p>caption: "Roles"</p>
<p>});</p>
</p>
<p>$("#grdRoles").navGrid("#pgrRoles", { add: true, edit: false, del: false, search: false },</p>
<p>{</p>
<p>// edit options</p>
<p>},</p>
<p>{ // add options</p>
<p>width: 350,</p>
<p>recreateForm: true,</p>
<p>beforeShowForm: function (form) {</p>
<p>$(&#39;#tr_DateEntered&#39;, form).hide();</p>
<p>$(&#39;#tr_DateEnteredOrig&#39;, form).hide();</p>
<p>$(&#39;#tr_EnteredBy&#39;, form).hide();</p>
<p>},</p>
<p>errorTextFormat: function (data) {</p>
<p>if (data.responseText.substr(0, 6) == "&#60;html ") {</p>
<p>return $(data.responseText).html();</p>
<p>}</p>
<p>else {</p>
<p>var obj = $.parseJSON(data.responseText);</p>
<p>return obj.ErrorMessage;</p>
<p>}</p>
<p>},</p>
<p>closeAfterAdd: true</p>
<p>}</p>
<p>);</p>
]]></description>
        	        	<pubDate>Thu, 27 Jan 2011 20:25:38 +0200</pubDate>
        </item>
        <item>
        	<title>jreisz on Allow form edit to call dataUrl each time form is opened</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21640</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21640</guid>
        	        	<description><![CDATA[<p>Oleg,</p>
<p>Thank you very much for the recreateForm property.&#160; It is exactly what I needed.</p>
]]></description>
        	        	<pubDate>Wed, 12 Jan 2011 17:27:19 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on Allow form edit to call dataUrl each time form is opened</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21614</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21614</guid>
        	        	<description><![CDATA[<p>Do you use <a href="/jqgridwiki/doku.php?id=wiki:form_editing#properties" target="_blank">recreateForm:true</a> option? If not yet, try it. Probably it will solve your problem.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 11 Jan 2011 00:34:09 +0200</pubDate>
        </item>
        <item>
        	<title>jreisz on Allow form edit to call dataUrl each time form is opened</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21611</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/allow-form-edit-to-call-dataurl-each-time-form-is-opened#p21611</guid>
        	        	<description><![CDATA[<p>Is there a way to force form edit to call the dataUrl for a select list each time it is opened?&#160; I have two tabs with one grid on each tab.&#160; In the grid on tab #1, I enter values that are used in a select list in the grid on tab #2 so I will need the most up to date values for the select list.</p>
<p>The first time I open the form it makes the call to the server to get the select list, but for each successive open of the form it gets the data from cache.&#160; When I am in inline edit this isn&#39;t an issue since it calls the server each time for the select list.</p>
<p>Thanks for your help.</p>
]]></description>
        	        	<pubDate>Mon, 10 Jan 2011 22:48:06 +0200</pubDate>
        </item>
</channel>
</rss>