<?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: JQgrid and Jquery UI Modal Confirmation</title>
	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation</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/discussion/jqgrid-and-jquery-ui-modal-confirmation/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>rmvenancio on JQgrid and Jquery UI Modal Confirmation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21013</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21013</guid>
        	        	<description><![CDATA[</p>
<p>Hi OlegK,</p>
</p>
<p>Thanks a lot for your help, the code allways return false for debugging porposes.</p>
<p>Unfortenatly the use of checkOnUpdate and CkecOnSubmit not solves my problem. I don&#39;t want to look for changes made in the form but only check if a particular field (cost) have values. I have various scenarios (or use cases), but to simplify, imagine the following:</p>
</p>
<p>This field (cost) by default, are calculated (no needs user input). But the user have the possibility to input some value in the cost and in this case we don&#39;t want the cost value to be replaced with a calculated value without user authorization. In this case, and if the cost field have values, we should ask the user for a boolean choice: Yes or No (replace or not replace with automatic calculations).</p>
</p>
<p>I have succeed&#160; with an intermitiate solution :</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit832' value='Select Code' data-codeid='sfcode832' /></p>
<div class='sfcode' id='sfcode832'>
<p>beforeSubmit: function (postdata, formid) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; postdata.replace = true;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (postdata.cost) {&#160;&#160;&#160; // If Cost<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (!confirm(&#39;Replace Cost ? &#39;)) postdata.replace = false; // User don&#39;t want the value be replaced<br />&#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; return [true, &#34;Replace it&#34;, &#34;&#34;]; //In all other cases replace the value<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
</div>
<p>This is fine just for now, but is not a perfect solution. The cofirm box is awful and it "hurts" the Look and Feel of my application, the default buttons are a OK and Cancel instead of YES and NO .</p>
<p>When I opened this topic, I tought it was a jqgrid problem. Now, and after you point that the problem occurs essencialy because the dialog works in <strong>asynchronous </strong>mode I must admit that this is not a jqgrid issue. In any case, my solution works with a jqgrid and I need this behaviour/functionality working in a smooth way. I would like to ask you guys (and girls) possible ways to solve this issue (without using timeouts). Exists any dialogs windows working in synchronous mode ?</p>
</p>
<p>Thanks a lot for all your support.</p>
<p>Best regards,</p>
<p>Rui Ven&#226;ncio</p>
]]></description>
        	        	<pubDate>Fri, 26 Nov 2010 15:28:25 +0200</pubDate>
        </item>
        <item>
        	<title>OlegK on JQgrid and Jquery UI Modal Confirmation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21007</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21007</guid>
        	        	<description><![CDATA[<p>Hi rmvenancio,</p>
<p>first of all you code try to return code [false, ...] in all cases, but the main problem is that the <strong>$("#dialog-confirm").dialog</strong> will work&#160;<strong>asynchronous</strong>. So you program will return always with the return from the one of the last rows of your code.</p>
<p>Instead of the usage of <strong>$("#dialog-confirm").dialog</strong>&#160;I would recommend you to use<a href="/jqgridwiki/doku.php?id=wiki:form_editing#properties" target="_blank"> checkOnSubmit:true</a> or <a href="/jqgridwiki/doku.php?id=wiki:form_editing#properties" target="_blank">checkOnUpdate:true</a>. Read careful the documentation of the parameters and be sure that you will see the confirmation dialog only <strong>if any data is changed in the form</strong>.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Thu, 25 Nov 2010 22:57:34 +0200</pubDate>
        </item>
        <item>
        	<title>rmvenancio on JQgrid and Jquery UI Modal Confirmation</title>
        	<link>http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21002</link>
        	<category>Discussion</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/discussion/jqgrid-and-jquery-ui-modal-confirmation#p21002</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I want to have a confirmation window when the user pressed the submit button. Depending on the user choice, the data passed to the server will be different.</p>
</p>
<p>The problem is that I get&#160; allways the following message before the user confirmation :</p>
<p>"What the F***, Why I reach this code ?"</p>
</p>
<p>Anyone have implemented anything similar ?</p>
</p>
<p>Thanks.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8532' value='Select Code' data-codeid='sfcode8532' /></p>
<div class='sfcode' id='sfcode8532'>
<p>beforeSubmit: function (postdata, formid) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (postdata.cost) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(function () {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#dialog:ui-dialog").dialog("destroy");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#dialog-confirm").dialog({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; resizable: 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; height: 200,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 300,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; closeOnEscape: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 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; buttons: {<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; &#39;Yes&#39;: function () {<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; $(this).dialog("close");<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; alert("Yes");<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; return [false, "I pressed Yes", ""];<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; },<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; &#39;No&#39;: function () {<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; $(this).dialog("close");<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; return [false, "I pressed False", ""];</p>
<p>&#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; }<br />&#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; });<br />&#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; else return [true, "No problem", ""];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [false, "What the F***, Why I reach this code ? ", ""];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
</div>
]]></description>
        	        	<pubDate>Thu, 25 Nov 2010 17:50:00 +0200</pubDate>
        </item>
</channel>
</rss>