<?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: Custom drop-down edittype not working</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working</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/custom-drop-down-edittype-not-working/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Gil on Custom drop-down edittype not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p18125</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p18125</guid>
        	        	<description><![CDATA[<blockquote>
<p>tony said:</p>
<p>Hello,</p>
<p>Not sure but you shoud define close event in the UI dialog and do</p>
<p>$(this).dialog( "destroy"        );</p>
</p>
<p>Regards</p>
<p>Tony</p>
</blockquote>
<hr />
<p>&#160;Tony,</p>
</p>
<p>I tried this, but the result was the same. Also, I have sent you an email with some additional information. I hope it was not intercepted by a spam filter.</p>
</p>
<p>Regards,</p>
]]></description>
        	        	<pubDate>Tue, 22 Jun 2010 15:53:09 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Custom drop-down edittype not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p18075</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p18075</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Not sure but you shoud define close event in the UI dialog and do</p>
<p>$(this).dialog( "destroy"        );</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sun, 20 Jun 2010 12:11:46 +0300</pubDate>
        </item>
        <item>
        	<title>Gil on Custom drop-down edittype not working</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p17983</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/custom-drop-down-edittype-not-working#p17983</guid>
        	        	<description><![CDATA[<p>I have a custom edit dialog control that is supposed to work as follows: </p>
<ul>
<li>The custom&#160;&#160;"edittype" contains a select control (drop-down list) and a "Find" button.</li>
<li>The button "onclick" event launches a "search" dialog that contains a text box and "submit" and "cancel" buttons.&#160;&#160;When the submit button is clicked, an AJAX server call is made, and a list (for the drop-down) is created &#8211; based on the criteria in the text box &#8211; and returned.</li>
</ul>
<p>To prototype this, I created a jQuery dialog with a select control and button, and I called my dialog from it. It worked as specified.</p>
<p>When I incorporate it into the editGridRow dialog, it fails as follows: the "search" dialog opens for a second and then both the search and edit dialog close and my grid refreshes.</p>
<p>It appears that I have not properly implemented the "handshake" with jqGrid. (Although, I don&#39;t know what is wrong.) I&#39;d appreciate any help and suggestions. The code follows.</p>
<dl>
<dt>The jqGrid column model entry for the custom form element:</dt>
<dt>
<p><input type='button' class='sfcodeselect' name='sfselectit5647' value='Select Code' data-codeid='sfcode5647' /></p>
<div class='sfcode' id='sfcode5647'>&#160;&#160;{ name:&#39;ItemId&#39;, index:&#39;ItemId&#39;, hidden:true, width:40, resizable:false, fixed:true, <br />&#160;&#160;&#160;&#160;align:&#39;left&#39;, editable:true, editrules:{edithidden:true}, edittype:&#39;custom&#39;, <br />&#160;&#160;&#160;&#160;editoptions:{ custom_element:SearchSelectElem, custom_value:SearchSelectVal } },</div>
</p>
</dt>
<dt></dt>
<dt>The HTML to launch the edit dialog:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit240' value='Select Code' data-codeid='sfcode240' /></p>
<div class='sfcode' id='sfcode240'>&#160;&#160;&#60;a href=&#34;#&#34; class=&#34;jqg-grid-edit&#34; <br />&#160;&#160;&#160;&#160;onclick=&#34;jQuery(&#39;#jqg_table&#39;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.jqGrid( &#39;editGridRow&#39;, 1, <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;{ width:400, savekey:[true,13], url:&#39;/Account/UserEdit&#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;modal:true, reloadAfterSubmit:true, 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;onclickSubmit:CreatePostList, afterSubmit:CheckSubmitStatus } );&#34;&#62;<br />&#160;&#160;&#160;&#160;&#60;span class=&#34;ui-icon ui-icon-pencil&#34;&#62;&#60;/span&#62;<br />&#160;&#160;&#60;/a&#62;</div>
</p>
</dt>
<dt></dt>
<dt>The custom element code (SearchSelectElem) builds the following control:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1761' value='Select Code' data-codeid='sfcode1761' /></p>
<div class='sfcode' id='sfcode1761'>&#160;&#160;&#60;div&#62;<br />&#160;&#160;&#160;&#160;&#60;select id=&#34;ItemId-sel&#34; style=&#34;width: 200px;&#34; size=&#34;1&#8243;&#62;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#60;option value=&#34;1&#8243;&#62;Current Item&#60;/option&#62;<br />&#160;&#160;&#160;&#160;&#60;/select&#62;<br />&#160;&#160;&#160;&#160;&#60;button id=&#34;ItemId-btn&#34; onclick=&#34;ShowDlog();&#34;&#62;Find&#60;/button&#62; <br />&#160;&#160;&#60;/div&#62;</div>
</dt>
<dt></dt>
<dt>The js code triggered by the button&#39;s onclick event:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5819' value='Select Code' data-codeid='sfcode5819' /></p>
<div class='sfcode' id='sfcode5819'>&#160;&#160;function ShowDlog()<br />&#160;&#160;{<br />&#160;&#160;&#160;&#160;// create the dialog content and attache it to the custom element field<br />&#160;&#160;&#160;&#160;//&#160;&#160;&#160;(I got the same resultes when I appended it to my &#34;main content&#34; div.)<br />&#160;&#160;&#160;&#160;var dlog = &#39;&#60;div id=&#34;ItemId-dlog&#34; title=&#34;Search Clients&#34; style=&#34;display:none&#34;&#62;&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;+&#160;&#160;&#160;&#39;&#60;input type=&#34;text&#34; id=&#34;ItemId-dlog-inp&#34; name=&#34;ItemId-dlog-inp&#34;&#62;&#39;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;+ &#39;&#60;/div&#62;&#39;;<br />&#160;&#160;&#160;&#160;jQuery(&#39;#ItemId&#39;).append( dlog );</p>
<p>&#160;&#160;&#160;&#160;// create the dialog<br />&#160;&#160;&#160;&#160;jQuery(&#39;#ItemId-dlog&#39;)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.dialog({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;autoOpen: false, modal: true, title: &#39;Search clients&#39;, position: [120,120],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;buttons:<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#39;Find&#39;: function () { jQuery(this).trigger(&#39;submit&#39;); },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Cancel: function () { jQuery(this).dialog(&#39;close&#39;); }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;})<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.bind(&#39;submit&#39;, function(event) { Dlog_Post( event ); });<br />&#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;// open it<br />&#160;&#160;&#160;&#160;jQuery(&#39;#ItemId-dlog&#39;).dialog(&#39;open&#39;);<br />&#160;&#160;}</p>
</div>
</dt>
</dl>
]]></description>
        	        	<pubDate>Thu, 17 Jun 2010 00:58:09 +0300</pubDate>
        </item>
</channel>
</rss>