<?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: Tip - using jquery UI autocomplete with jqgrid.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid</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/tip-using-jquery-ui-autocomplete-with-jqgrid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>nelsonm on Tip - using jquery UI autocomplete with jqgrid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p27459</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p27459</guid>
        	        	<description><![CDATA[<p>All i know is that you need to attach the jquery autocomplete widget to the datainit object of the editoptions method in jqgrid as follows&#8230;</p>
</p>
<blockquote>
<p>{name:&#39;cu.LastName&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160; index:&#39;cu.LastName&#39;,&#160;&#160;&#160;&#160;&#160;&#160;&#160; width:150, fixed: true, align:&#39;center&#39;, hidden:false, sortable: true, editable: true, edittype:&#160;&#160;&#160; &#39;text&#39;,<br />editoptions:{size:25, dataInit:function(e){$(e).autocomplete({ source: &#39;php/cu-autocomplete-script.php&#39;,</p>
<p>minLength: 1,<br />select: function(event, ui){event.preventDefault();<br />var name = ui.item.label.split(&#39;. &#39;, 2);<br />// update editform workorder, customer and billing address fields with server side table data.<br />$(&#39;input#id&#39;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; ).val(ui.item.value);<br />$(&#39;input#cu.FRID&#39;&#160; &#160; &#160; &#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; ).val(ui.item.FRID);<br />$(&#39;input#cu.BusinessName&#39;&#160; ).val(ui.item.BusinessName);<br />$(&#39;input#cu.LastName&#39;&#160; &#160; &#160; &#160;&#160; ).val(name[0]);<br />$(&#39;input#cu.FirstName&#39; &#160; &#160; &#160;&#160; ).val(name[1]);<br />$(&#39;input#cu.Street&#39;&#160;&#160;&#160; &#160; &#160; &#160;&#160; &#160;&#160; ).val(ui.item.Street);<br />$(&#39;input#cu.City&#39;&#160;&#160;&#160;&#160;&#160; &#160; &#160; &#160; &#160; &#160;&#160; ).val(ui.item.City);<br />$(&#39;select#cu.STID&#39;&#160;&#160;&#160; &#160; &#160; &#160;&#160; &#160;&#160;&#160; ).val(ui.item.STID); // must use id for select box to update after autocomplete.<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;&#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;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;},<br />focus: function(event, ui) {event.preventDefault();}})}},<br />formoptions:{rowpos: 3, label:&#39;Customer Last Name&#39;, elmprefix:&#39;* &#39;, elmsuffix:&#39; (Min. 2 characters required for search)&#39;}, editrules:{required:true}},</p>
</blockquote>
<p>It really that simple.</p>
]]></description>
        	        	<pubDate>Tue, 02 Oct 2012 00:07:50 +0300</pubDate>
        </item>
        <item>
        	<title>ajpb on Tip - using jquery UI autocomplete with jqgrid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p27445</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p27445</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I am unable to find your post..</p>
<p>I am using the latest version of jqGrid, and trying to attach the autoComplete event to 2 fields in the edit Form. The callbacks are called fine, the only problem is the drop down list does not show and is not displayed. Appreciate beyond words can express for your help and any info you can provide. Here is my code:</p>
<p>I have the autoComplete function attached to the field in the onInitializeForm method (the field whch is defined in my ColModel as PlatformCode_ItemMajor_Code is the one I want it to have autoComplete (I am using ASP.NET MVC 3 using the free version of jqGrid)</p>
</p>
<p>onInitializeForm: function (formId) {</p>
<p>$("#<strong>PlatformCode_ItemMajor_Code</strong>").<strong>autocomplete({</strong></p>
<p>source: function (request, response) {</p>
<p>$.ajax({</p>
<p>url: "/DataManagement/findItemMajors", type: "POST", dataType: "json",</p>
<p>data: { searchText: request.term, maxResults: 10 },</p>
<p>success: function (data) {</p>
<p>response($.map(data, function (item) {</p>
<p>return { label: item.Code + ":" + item.Name, value: item.Code, id: item.Id }</p>
<p>}))</p>
<p>}</p>
<p>})</p>
<p>},</p>
<p>select: function (event, ui) {</p>
<p>// alert("ui.item.Id="+ui.item.id);</p>
<p>$("#PlatformCode_ItemMajorId").val(ui.item.id);</p>
<p>var str = $("#PlatformDescription").val();</p>
<p>// alert("str="+str);</p>
<p>var substr = str.split("-");</p>
<p>if (substr[1] != null)</p>
<p>str = ui.item.label.split(&#39;:&#39;)[1] + "-" + substr[1];</p>
<p>else</p>
<p>str = ui.item.label.split(&#39;:&#39;)[1] + "-";</p>
</p>
<p>//alert("str="+str+",substr[0]="+substr[0]+",str[1]="+substr[1]+",ui.item.label.split(&#39;:&#39;)[1]="+ui.item.label.split(&#39;:&#39;)[1]);</p>
<p>if (substr != null &#38;&#38; substr != "" &#38;&#38; substr[1] != null &#38;&#38; substr[0] != null)</p>
<p>str = ui.item.label.split(&#39;:&#39;)[1] + "-" + substr[1];</p>
</p>
<p>$("#PlatformDescription").val(str);</p>
</p>
<p>alert("$(#PlatformDescription)=" + $("#PlatformDescription").val());</p>
<p>}</p>
<p>});</p></p>
]]></description>
        	        	<pubDate>Sun, 30 Sep 2012 03:18:51 +0300</pubDate>
        </item>
        <item>
        	<title>nelsonm on Tip - using jquery UI autocomplete with jqgrid.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p25138</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/tip-using-jquery-ui-autocomplete-with-jqgrid#p25138</guid>
        	        	<description><![CDATA[<p>After many days of frustration and research, i have come up with helpful info on using jquery UI autocomplete with jqgrid.</p>
<p>Please read the last post in this thread: <a href="http://www.trirand.com/blog/?page_id=393/help/while-the-select-editoption-posts-the-value-or-id-of-the-selected-list-item-autocomplete-posts-the-label-i-need-id-posted/" rel="nofollow" target="_blank"><a href="http://www.trirand.com/blog/?p" rel="nofollow">http://www.trirand.com/blog/?p</a>.....id-posted/</a></p>
]]></description>
        	        	<pubDate>Fri, 11 Nov 2011 21:48:36 +0200</pubDate>
        </item>
</channel>
</rss>