<?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: auto complete</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete</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/feature-request/auto-complete/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>dhubenov on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20628</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20628</guid>
        	        	<description><![CDATA[<p>Just an update to the last post:</p>
<p>The <a title="autocompleter.rar" href="http://kst.dtector.eu/datas/download/autocompleter.rar" target="_blank">examples file</a> now includes both form- and inline-editing examples.</p>
<p>In order to use autocomplete plugin with inline editing you just need to modify this part:<br />.result(function(e, item) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#"+ <span style="color: #ff0000;"><strong><em>variable_holding_row_id</em></strong></span> +"<strong><span style="color: #ff0000;">_</span></strong><strong><em>my_customId</em></strong>").val(item.<strong><em>res_id</em></strong> );<br />&#160;});<br />Apparently jqgrid is building the <em>name</em> and <em>id</em> of the input tag in different manner. The difference is that in inline editing you have to add the rowId of the currently edited row. That&#39;s all.</p>
<p>Have a great day.</p>
]]></description>
        	        	<pubDate>Tue, 02 Nov 2010 09:34:36 +0200</pubDate>
        </item>
        <item>
        	<title>dhubenov on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20624</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20624</guid>
        	        	<description><![CDATA[<p>Hi Antonia,</p>
<p>If you have another look at post #2 you&#39;ll see the following code:<br />&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;<strong><em>my_customId</em></strong>&#39;, index:&#39;my_customId&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:<strong>true</strong>, hidden:<strong>true</strong>, search:<strong>false</strong> <br />&#160;&#160;&#160;&#160;&#160; }<br />This is a hidden column of the grid. But besause it is editable, when the add/edit dialog is generated, there will be an input element with id and name <strong><em>my_customId</em></strong> . So it isn&#39;t a div or span - a simple input <img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" /><br />How do we update its value on selection? With this line:<br />$("#<strong><em>my_customId</em></strong>").val(item.<strong><em>res_id</em></strong>);</p>
<p>I can&#39;t tell what is wrong with your code. My cristal ball is broken ... couple of months already <img class="spSmiley" style="margin:0" title="Laugh" src="/blog/wp-content/forum-smileys/sf-laugh.gif" alt="Laugh" /><br />But I have another idea. I&#39;ve made an example and you are free to download it from <a title="autocompleter.rar" href="http://kst.dtector.eu/datas/download/autocompleter.rar" target="_blank">here</a>. I&#39;ve tried to keep it simple - no DB or any fancy stuff in it. I hope you&#39;ll find it useful and it will give you a better understanding of where is the troublemaker.</p>
<p>Happy coding! And don&#39;t hesitate to ask for more help. <img class="spSmiley" style="margin:0" title="Smile" src="/blog/wp-content/forum-smileys/sf-smile.gif" alt="Smile" /></p>
]]></description>
        	        	<pubDate>Tue, 02 Nov 2010 02:41:18 +0200</pubDate>
        </item>
        <item>
        	<title>antonia on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20582</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20582</guid>
        	        	<description><![CDATA[<p>Hi dhubenov,</p>
</p>
<p>thanks for answering so fast (even after such a long time after your initial post 🙂 ).</p>
<p>Regarding the item.res_id: that was actually no problem, as it is logic to me after implementation.</p>
<p>The main problem which I face is that I don&#39;t get any value posted from the form for the variable "my_customId".</p>
</p>
<p>I actually don&#39;t understand how to update the my_customId from within the colModel when choosing the my_customName.</p>
<p>It seems you have another div or span within your html code with the ID "my_customID" but how would you use it in the form?</p>
</p>
<p>My scenario currently: Usual grid and the colModel with the entries my_customName and my_customId.</p>
<p>Autocomplete works fine.</p>
<p>But when submitting only the post variable my_customName is set with the correct name / value of the element (that&#39;s perfect) but the variable my_customId is empty.</p>
<p>I do understand that it is the last "return" statement posted in my initial post which should set the my_customId but maybe I missed something else ?</p>
</p>
<p>Many thanks</p>
<p>Antonia</p>
]]></description>
        	        	<pubDate>Sun, 31 Oct 2010 09:30:16 +0200</pubDate>
        </item>
        <item>
        	<title>dhubenov on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20576</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20576</guid>
        	        	<description><![CDATA[<p>Antonia,</p>
<p>You are right. It is my mistake in post #2.<br />The correct line is:</p>
<p>.result(function(e, item) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#<strong><em>my_customId</em></strong>").val(item.<strong><em>res_id</em></strong> );<br />&#160;});</p>
<p>Sorry about that.</p>
<p>Btw the Autocomplete plugin is already part of jQuery UI. You can find some more information at <a href="http://jqueryui.com/demos/autocomplete/#remote" target="_blank">jqueryui.com/demos/autocomplete</a></p>
<p>If you need further help you can send some source to my email <em>&#60;use_my_nickname</em>@gmail.com&#62;</p>
]]></description>
        	        	<pubDate>Sat, 30 Oct 2010 06:29:59 +0300</pubDate>
        </item>
        <item>
        	<title>antonia on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20562</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p20562</guid>
        	        	<description><![CDATA[<p>Hi dhubenov,</p>
</p>
<p>many thanks for your work.</p>
<p>It works nicely but on one part I have a problem. The my_customId is not posted to the server.</p>
<p>It is this code:</p>
<p style="padding-left: 60px;">.result(function(e, item) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#<strong><em>my_customId</em></strong>").val(item.<strong><em>res_name</em></strong> );<br />&#160;});</p>
<p style="padding-left: 60px;">&#160;</p>
<p>First of all I think this should be "item.res_id". But still the variable is not set correctly.</p>
<p>Then it seems to me as if it would be a id-element. But since we are in the context of the colModel I am not sure how to address it correctly.</p>
</p>
<p>Do you have any hint so that the ID gets posted correctly? my_customName works as it should.</p>
</p>
<p>Thanks again</p>
<p>Antonia</p>
]]></description>
        	        	<pubDate>Fri, 29 Oct 2010 14:17:30 +0300</pubDate>
        </item>
        <item>
        	<title>dhubenov on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p19728</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p19728</guid>
        	        	<description><![CDATA[<p>Hi, bhoomi</p>
<p>Have a look at this line:</p>
<p>return $.map(<strong>data</strong>, function (item) {...});</p>
<p>At this point <strong>data</strong> is just a STRING containing JSON object... so for us to be able to use the object - we need to convert the string using <strong>eval()</strong> function.</p>
<p>So I think the solution for your trouble is to modify the line like:</p>
<p>return $.map(<strong>eval(data)</strong>, function (item) {...});</p>
</p>
<p>Please post a reply if this fixes the issue.</p></p>
]]></description>
        	        	<pubDate>Sun, 12 Sep 2010 09:47:53 +0300</pubDate>
        </item>
        <item>
        	<title>bhoomi on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p19627</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p19627</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I am having the same problem. Looked at almost all the samples but none work for me.</p>
<p>M using ASP.NET MVC. Grid populates the data. Form editing is working fine. On submit it posts the data to corresponding controller.</p>
<p>But in Autocomplete controller method is not invoked. Tried everything pl help.</p>
<p>Below is my code :</p>
<p>$("#RegionAndCity").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;/BriefAllocation/GetRegionAndCities/?briefId=&#39; + briefallocationid,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; prmNames: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; briefId: briefallocationid<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;AllocatedRegionAndCitiesId&#39;, &#39;BriefAllocationId&#39;, &#39;LocationId&#39;, &#39;LocationName&#39;, &#39;PlannerId&#39;, &#39;Region&#39;, &#39;Budget&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<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; { name: &#39;AllocatedRegionAndCitiesId&#39;, index: &#39;AllocatedRegionAndCitiesId&#39;, width: 100, align: &#39;left&#39;, /* key: true,*/editable: true, editrules: { edithidden: false }, hidedlg: true, hidden: 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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;BriefAllocationId&#39;, index: &#39;BriefAllocationId&#39;, width: 150, align: &#39;left&#39;, editable: false, edittype: &#39;text&#39;, editrules: { required: true }, formoptions: { elmsuffix: &#39; *&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;LocationId&#39;, index: &#39;LocationId&#39;, width: 150, align: &#39;left&#39;, editable: false, edittype: &#39;text&#39;, editrules: { required: true }, formoptions: { elmsuffix: &#39; *&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;LocationName&#39;, index: &#39;LocationName&#39;, width: 300, align: &#39;left&#39;, editable: true, edittype: &#39;text&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions: { dataInit: function (elem) {<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; setTimeout(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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(elem).autocomplete(&#39;&#60;%= Url.Action("FindLocation" , "Shared" ) %&#62;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: "ajax",<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; multiple: 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;&#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; formatItem: function (item, index, total, query) {<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; return item.value;<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;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; parse: function (data) {<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; return $.map(data, function (item) {<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; return {<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; data: item,<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; value: item.Key,<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; result: item.value<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; }<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; });<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; }<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; }).result(function (event, row) {<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; $("#LocationId").val(row.Key);<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;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, 100);<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; }<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; }, editrules: { required: 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;&#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;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;PlannerId&#39;, index: &#39;PlannerId&#39;, width: 150, align: &#39;left&#39;, editable: true, edittype: &#39;text&#39;, editrules: { required: 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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Region&#39;, index: &#39;Region&#39;, width: 100, align: &#39;left&#39;, editable: true, edittype: &#39;text&#39;, editrules: { required: true }, formoptions: { elmsuffix: &#39; *&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;Budget&#39;, index: &#39;Budget&#39;, width: 100, align: &#39;left&#39;, editable: true, edittype: &#39;text&#39;, editrules: { required: true }, formoptions: { elmsuffix: &#39; *&#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;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; beforeEditCell:function(rowid,cellname,value,irow,icol){<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; alert("Before Edit!");<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; pager: $(&#39;#listPager&#39;),<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 10,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [5, 10, 20, 50],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;AllocatedRegionAndCitiesId&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: "asc",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; imgpath: &#39;/scripts/themes/steel/images&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;&#60;b&#62;Regions And Cities&#60;/b&#62;&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ondblClickRow: function (rowid, iRow, iCol, e) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#RegionAndCity").editGridRow(rowid, prmGridDialog);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }).navGrid(&#39;#listPager&#39;, { edit: true, add: true, del: true, refresh: true },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; updateDialog,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; updateDialog,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; updateDialog);</p>
</p>
<p>M trying to populate locationName.</p>
<p>On server side i have</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public ActionResult FindLocation(string q, int limit)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; string q="";<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ///Get json data. This method works for autocomplete outside grid.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Content(json);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</p>
<p>Pl help.</p></p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 09:45:43 +0300</pubDate>
        </item>
        <item>
        	<title>dhubenov on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p8888</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p8888</guid>
        	        	<description><![CDATA[<p>Hi <strong></strong><strong>redsuitee,</strong></p>
<p>It&#39;s quite easy job. You probably already have found the solution for this problem but it may be usefull to someone else too.<br />First of all you&#39;ll need an autocomplete jQuery plugin. I would recomend&#160;  <strong>Autocomplete &#8211; jQuery plugin</strong> (current version 1.0.2) &#160; by Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, J&#246;rn Zaefferer. You can find it <a title="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" href="http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/" target="_blank">here</a><br />&#160;<br />This is a simplified example of setting autocomplete to a two fields:</p>
<ul>
<li> one of them holding the ID (value) of what we need (hidden one) </li>
<li>the other (visible in the edit dialog) &#8211; holding the value (label, text, you name it)</li>
</ul>
<p>You can think of this model as a <em><strong>select</strong></em> but we need couple of columns to hold both value and visible text</p>
<ol>
<li>Make sure you included the autocomplete plugin files in the header:<br /> &#60;<span class="start-tag">link</span><span class="attribute-name"> href</span><span>="your_path_to</span>/autocomplete/jquery.autocomplete.css<span>" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/css" </span><span class="attribute-name">rel</span>=<span class="attribute-value">"stylesheet" </span><span class="error"><span class="attribute-name">/</span></span>&#62;<br />&#60;<span class="start-tag">script</span><span class="attribute-name"> src</span><span>="</span><span>your_path_to</span>/autocomplete/jquery.autocomplete.js<span>" </span><span class="attribute-name">type</span>=<span class="attribute-value">"text/javascript"</span>&#62;&#60;/<span class="end-tag">script</span>&#62;
</li>
<li>Integrate autocompleter as follows <br /> $(&#8221;#querieslist&#8221;)..jqGrid({<br /> &#160; // &#8230; some grid options &#8230;<br /> &#160; colModel :[<br /> &#160;&#160;&#160;&#160; { // ... some column definitions ... },<br /> &#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;<strong><em>my_customId</em></strong>&#39;, index:&#39;my_customId&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:<strong>true</strong>, hidden:<strong>true</strong>, search:<strong>false</strong> <br />&#160;&#160;&#160;&#160;&#160; }, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; name:&#39;my_customName&#39;, index:&#39;my_customName&#39;, label: &#39;My automplete column&#39;, width:200, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable:<strong>true</strong>, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#39;text&#39;, // edittype&#39;s default is &#39;text&#39; so you don&#39;t really need it here. <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions: {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; size:64, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; maxlength:255, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>dataInit</strong>:function (elem) { // the moment of magic <img class="spSmiley" style="margin:0" title="Wink" src="/blog/wp-content/forum-smileys/sf-wink.gif" alt="Wink" /><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(elem)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .autocomplete( // for more info check the autocomplete plugin docs<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#39;path_to_serverside.php?some_get_option=if_we_need_it&#38;another_option=goes_here&#39;, {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: &#39;ajax&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; multiple: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; parse: function(data) { // parsing json input<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160; return $.map(eval(data), function(row) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (typeof(row) == &#39;object&#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; ? { data: row, value: row.<em><strong>res_id</strong></em>, result: row.<strong><em>res_name</em></strong> } // same in the serverside<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : { data: row, value: &#39;&#39;,&#160;&#160;&#160;&#160;&#160; result: &#39;&#39;&#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; formatItem: function(item) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return (typeof(item) == &#39;object&#39;)?item.<strong><em>res_name</em></strong> :&#39;&#39;;<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; }<br />&#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; .result(function(e, item) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#<strong><em>my_customId</em></strong>").val(item.<strong><em>res_name</em></strong> );<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; });<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }},&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; searchoptions:{sopt:[&#39;bw&#39;,&#39;bn&#39;,&#39;eq&#39;,&#39;ne&#39;,&#39;ew&#39;,&#39;en&#39;,&#39;cn&#39;,&#39;nc&#39;,&#39;in&#39;,&#39;ni&#39;]}<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { // &#8230; some column definitions &#8230; }
<p> });</p>
</li>
<li>Now let&#39;s have a look at the serverside script (.php)
<p>header(&#39;Content-Type: application/x-json; charset=utf-8&#39;);<br />// both vars are generated by autocomplete so you just catch them here<br />$q = $_GET[&#39;q&#39;];<br />$limit = $_GET[&#39;limit&#39;]<br />// don&#39;t forget to catch your own variables (if you set some)<br />// &#8230;</p>
<p>// I will not bother to explain sql query in details &#8211; I&#39;m sure you can figure it out <br /><span class="refname">// It will look like:<br /></span><span class="methodname">$mySqlQuery = mysql_query</span><span class="refname">(&#8221;SELECT `id`, `value` FROM `sqlTable` WHERE `value` LIKE &#39;%&#8221;.</span><span class="refname">mysql_real_escape_string($q)</span><span class="refname">.&#8221;%&#39; LIMIT </span><span class="refname">&#8220;.</span><span class="refname">mysql_real_escape_string($</span>limit<span class="refname">)</span><span class="refname">)</span>;<br />$res = array();<br />if (<span class="methodname">mysql_num_rows</span>(<span class="methodname">$mySqlQuery</span>) &#62; 0) {<br />&#160;&#160;&#160; while ($row = <span class="refname">mysql_fetch_assoc(</span><span class="methodname">$mySqlQuery</span><span class="refname">)) {<br /> &#160;&#160;&#160;&#160;&#160;&#160; $res[] = &#39;{</span><em><strong>res_id</strong></em><span class="refname">:&#8221;&#39;.str_replace(&#39;&#8221;&#39;,&#39;\\\\&#8221;&#39;,$t_row[&#39;id&#39;]).&#39;&#8221;,</span><strong><em>res_name</em></strong><span class="refname">:&#8221;&#39;.str_replace(&#39;&#8221;&#39;,&#39;\\\\&#8221;&#39;,$t_row[&#39;value&#39;]).&#39;&#8221;}&#39;;<br />&#160;&#160;&#160; }</span><br />&#160;} else {<br />&#160;&#160;&#160;&#160; $res[] = &#39;{<em><strong>res_id</strong></em>:&#8221;0&#8243;,<strong><em>res_name</em></strong>:&#8221;Try again&#8221;}&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160; echo &#39;[&#39;.implode(&#39;,&#39;,$res).&#39;]&#39;; exit;</p>
</li>
</ol>
<p>I hope this post will give you a clue HOW to make it. If you have more specific questions &#8211; just ask.</p>
]]></description>
        	        	<pubDate>Fri, 21 Aug 2009 03:57:43 +0300</pubDate>
        </item>
        <item>
        	<title>redsuitee on auto complete</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p6318</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/auto-complete#p6318</guid>
        	        	<description><![CDATA[<p>can anybody give me some example to build an auto complete program..</p>
<p>thanx</p>
<p>-md-</p>
]]></description>
        	        	<pubDate>Sun, 26 Apr 2009 21:26:17 +0300</pubDate>
        </item>
</channel>
</rss>