<?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: Add autocomplete to select dropdown box</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/add-autocomplete-to-select-dropdown-box</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/add-autocomplete-to-select-dropdown-box/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>pdaniel on Add autocomplete to select dropdown box</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/add-autocomplete-to-select-dropdown-box#p25275</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/add-autocomplete-to-select-dropdown-box#p25275</guid>
        	        	<description><![CDATA[<p>I currently have the following grid which contains a select box for displaying project names (ProjectID column) for a .Net app. I would like to add the autocomplete function to this select box. I have seen other posts on here for this topic but have not been able to get it to work. I also don&#39;t want to oversimplyfy this as it&#39;s my first experience with jqgrid. Any suggestions on where to start would be appreciated. I saw examples that build out the combobox via embedded html inside the javascript code, but would like to try to avoid this if at all possible. I&#39;d like to try to minimize the change I&#39;ll need below to accomplish this. Thanks in advance for your time!</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery("#divGrid").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;Project&#39;, &#39;WorkType&#39;, &#39;MON&#39;, &#39;TUE&#39;, &#39;WED&#39;, &#39;THU&#39;, &#39;FRI&#39;, &#39;SAT&#39;, &#39;SUN&#39;, &#39;&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;ProjectID&#39;, index: &#39;ProjectID&#39;, width: 300, align: "left", editable: true, formatter: &#39;select&#39;, edittype: &#39;select&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions: { value: projectlist, dataEvents:<br />&#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; { type: &#39;change&#39;, fn: function (e) {<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery.data(document.body, "projID", $(this).val());<br />&#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; },<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { type: &#39;focus&#39;, fn: function (e) {<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery.data(document.body, "projID", $(this).val());<br />&#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; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;WorkType&#39;, index: &#39;WorkType&#39;, width: 140, align: "left", editable: true, formatter: &#39;select&#39;, edittype: &#39;select&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions: { value: worktypelist, dataEvents:<br />&#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; { type: &#39;change&#39;, fn: function (e) {<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery.data(document.body, "workType", $(this).val());<br />&#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; },<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { type: &#39;focus&#39;, fn: function (e) {<br />&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jQuery.data(document.body, "workType", $(this).val());<br />&#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; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;MON&#39;, index: &#39;MON&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;TUE&#39;, index: &#39;TUE&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;WED&#39;, index: &#39;WED&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;THU&#39;, index: &#39;THU&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;FRI&#39;, index: &#39;FRI&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;SAT&#39;, index: &#39;SAT&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;SUN&#39;, index: &#39;SUN&#39;, width: 50, align: "center", editable: true, editrules: { number: true }, editoptions: { size: "5&#8243;, maxlength: "5&#8243;} },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; { name: &#39;DELROW&#39;, index: &#39;DELROW&#39;, width: 40, align: "center", formatter: LinkFormatter }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cellEdit: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: "local",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: WeekSheet,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: "auto",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; gridview: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; hoverrows: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; authwidth: true,<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; forceFit: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: &#39;&#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; editurl: &#39;url&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cellsubmit: &#39;clientArray&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; hidegrid: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; onCellSelect: function (id, cellidx, cellvalue) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (($("#divGrid tr[id=&#39;" + id + "&#39;] td:eq(" + cellidx + ") input").val()) == 0)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { $("#divGrid tr[id=&#39;" + id + "&#39;] td:eq(" + cellidx + ") input").val(""); };<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; afterInsertRow: function (rowid, aData, rowElem) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#" + rowid + "").css("background", "yellow");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#divGrid tr[id=&#39;" + rowID + "&#39;] td:eq(0)").text("[Click to select project.]");<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $("#divGrid tr[id=&#39;" + rowID + "&#39;] td:eq(1)").text("[Click to select work type.]"); <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
</p>
<p>&#160;&#160;&#160; $(document).ready(function () {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; //get projects for select box<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $.ajax({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; async: false,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: "TimeSheet.aspx/GetProjectList",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataType: "json",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; data: "{}",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; contentType: "application/json; charset=utf-8",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; success: function (data, textStatus, jqXHR) {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; projectlist = data.d;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; });</p>
]]></description>
        	        	<pubDate>Wed, 30 Nov 2011 19:17:11 +0200</pubDate>
        </item>
</channel>
</rss>