<?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 dynamic select option</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option</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/jqgrid-dynamic-select-option/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9642</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9642</guid>
        	        	<description><![CDATA[<p>Tony,</p>
</p>
<p>I&#39;ve done that - that cleans up the editing, however when the grid first loads I still get undefined values for all cells in that column, as the formatCell is not being hit until I edit the cell and hence the dropdown values are empty.</p>
<p>So I need to somehow populate the cells initially (on load or just after) with one value - just the one they have currently selected, in order for the initial value to be displayed.</p>
<p>Where should I be doing that?</p>
</p>
<p>Thanks,</p>
<p>Jo</p>
]]></description>
        	        	<pubDate>Fri, 11 Sep 2009 20:05:22 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9546</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9546</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Could you please set so that formatCell return the value - i.e</p>
<p>formatCell : function(rowid, cellname, value, iRow, iCol)</p>
<p>{</p>
<p>// do something here</p>
<p>return value;</p>
<p>}</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 10 Sep 2009 04:04:45 +0300</pubDate>
        </item>
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9493</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9493</guid>
        	        	<description><![CDATA[<p>Tony,</p>
</p>
<p>I&#39;ve got the select options loading correctly now when editing, however&#160;because I&#39;m setting the edit options on formatCell, and hence there&#39;s nothing in there until the user click to edit the cell, the initial value when the grid loads comes up as "undefined".</p>
<p>Is there a way to force the grid to display the value passed in the table data, even if it doesn&#39;t exist in the drop down? Or to intercept the initial loading for each row and add the one option it needs based on the initial cell value? It would be the same case for paging.</p>
</p>
<p>Thanks.</p>
</p>
<p>Jo</p>
]]></description>
        	        	<pubDate>Tue, 08 Sep 2009 18:12:17 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9323</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9323</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>You forgot <strong>cellEdit:true</strong></p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 04 Sep 2009 04:55:49 +0300</pubDate>
        </item>
        <item>
        	<title>Martin on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9240</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9240</guid>
        	        	<description><![CDATA[<p>Hi Guys, I pulled the latest GitHub today, and created a jqGrid thus:</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; jQuery("#event").jqGrid({ <br />&#160;&#160;&#160; &#160;&#160;&#160; url:&#39;/index.php/EventController/search&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; mtype:"post", <br />&#160;&#160;&#160; &#160;&#160;&#160; width:740,</p>
<p>&#160;&#160;&#160;&#160;&#160; colNames:[&#39;Event No&#39;,&#39;Manager&#39;, &#39;Event Name&#39;,&#39;parent_id&#39;], <br />&#160;&#160;&#160; &#160;&#160;&#160; colModel:[ <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;id&#39;,index:&#39;id&#39;, width:50, align:"right", editable:false,editoptions:{readonly:true,size:10}}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;manager&#39;,index:&#39;manager&#39;,editable:false, width:80, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions:{rows:"1",cols:"20", readonly:true}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; formoptions:{ rowpos:1,elmprefix:"&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;" }},</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;name&#39;,index:&#39;name&#39;,editable:true, width:100, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; edittype:"select", formatter:"select",<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions:{rows:"1",cols:"20"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; formoptions:{ rowpos:2,elmprefix:"&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;" }},</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;parent_id&#39;,index:&#39;parent_id&#39;,editable:false, width:70, hidden:true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions:{rows:"1",cols:"20"}, <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; formoptions:{ rowpos:20,elmprefix:"&#38;nbsp;&#38;nbsp;&#38;nbsp;&#38;nbsp;" }}<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;],</p>
<p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; formatCell: function (id, cellname, value, iRow, iCol) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; var listdata = "1:Account1;2:Account2;3:Account3;4:Account4;";&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if (cellname == "name") {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //var listdata = GetNameValues(id, name);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; //if (listdata == null) listdata = "1:Unknown" ;&#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; <br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; jQuery("#event").setColProp(cellname, {editoptions: {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value: listdata.toString()<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;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; },</p>
<p>&#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:[10,20,50,100],<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; pager: jQuery(&#39;#pager1&#39;),<br />etc</p>
</p>
<p>in the grid definition, but I can&#39;t get Javascript to execute the function, tracing the program execution using Firebug, I can breakpoint the formatCell: line but the next line executed is the rowNum:10, nothing inside the function is ever executed.</p>
<p>Any ideas?</p>
</p>
<p>Thx</p>
<p>Martin</p></p>
]]></description>
        	        	<pubDate>Wed, 02 Sep 2009 18:28:09 +0300</pubDate>
        </item>
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9156</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9156</guid>
        	        	<description><![CDATA[<p>Great - thanks Tony!</p>
<p>Can you please give an indication as to when a new build of 3.5&#160;will be available so that I can get this to work too?</p>
</p>
<p>Regards,</p>
</p>
<p>Jo</p>
]]></description>
        	        	<pubDate>Mon, 31 Aug 2009 20:03:08 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9082</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p9082</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks. Fixed in GitHub and your example works in my demo.</p>
<p>Best Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Mon, 31 Aug 2009 04:14:29 +0300</pubDate>
        </item>
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8930</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8930</guid>
        	        	<description><![CDATA[<p>Tony,</p>
<p>I&#39;m using version 3.5 and here&#39;s the code I have:</p>
<p>&#160;jQuery(document).ready(function() { <br />var gridimgpath = &#39;../jQuery/jqGrid3.5/themes/basic/images/&#39;;<br />jQuery("#grid").jqGrid({<br />datatype: "local",<br />mtype: "GET",<br />height: 200, //{4},<br />colNames: ["RecordID", "AccountID", "EntityID", "YesNo", "Number1", "Number2", "ImportantDate"],<br />colModel: [<br />{ name: "RecID", index: "RecID", key: true, visible: false, width: 90, sorttype: "long", editable: false, resizable: true },<br />{ name: "AccountID", index: "AccountID", width: 90, editable: true, resizable: true, edittype: "select", formatter: "select" },<br />{ name: "EntityID", index: "EntityID", width: 90, editable: true, resizable: true, edittype: "select", formatter: "select", editoptions: { value: "1:Entity1;2:Entity2;3:Entity3;4:Entity4"} },<br />{ name: &#39;YesNo&#39;, width: 40, align: &#39;left&#39;, editable: true, formatter: checkboxFormatter, edittype: &#39;checkbox&#39; },<br />{ name: "Number1", index: "Number1", width: 60, align: "right", editable: true, resizable: true, formatter: "currency", editoptions: { size: 10} },<br />{ name: "Number2", index: "Number2", width: 60, align: "right", editable: true, resizable: true, formatter: "currency", editoptions: { size: 10} },<br />{ name: "ImportantDate", index: "ImportantDate", width: 130, editable: true, resizable: true, sorttype: "date", editoptions: { size: 12, dataInit: function(elem) { showdate(elem); } } }<br />],<br />formatCell: function(id, name, val, iRow, iCol) {<br />if (name == "AccountID") {<br />var listdata = "1:Account1;2:Account2;3:Account3;4:Account4";<br />jQuery("#grid").setColProp(&#39;AccountID&#39;, { editoptions: { value: listdata.toString()} });<br />}<br />}, <br />rowNum: 5,<br />rowList: [5, 10, 20, 50, 100, 400],<br />imgpath: gridimgpath,<br />pager: jQuery("#gridpager"),<br />sortname: "RecID",<br />viewrecords: true,<br />sortorder: "asc",<br />forceFit: true,<br />cellEdit: true,<br />cellsubmit: "clientArray",<br />viewsortcols: true,<br />rownumbers: true,<br />footerrow: true,<br />caption: "Test"<br />}).navGrid("#gridpager", { edit: false, add: true, del: true, search: false, view: false })<br />.navButtonAdd("#gridpager", { caption: "Save", onClickButton: function(id) { SaveChanges(); }, position: "last" });</p>
<p>function showdate(elem) {<br />$(elem).datepicker({ changeMonth: true, changeYear: true, yearRange: "-20:+20", dateFormat: "dd/mm/yy" });<br />};</p>
<p>function checkboxFormatter(cellvalue, options, rowObject) {<br />cellvalue = cellvalue + "";<br />cellvalue = cellvalue.toLowerCase();<br />var bchk = cellvalue.search(/(false&#124;0&#124;no&#124;off&#124;n)/i) &#60; 0 ? " checked=\\"checked\\"" : "";<br />//$(el).html("&#60;input type=&#39;checkbox&#39; onclick=\\"ajaxSave(&#39;" + cval.rowId + "&#39;, this);\\" " + bchk + " value=&#39;" + el + "&#39; offval=&#39;no&#39; /&#62;");<br />return "&#60;input type=&#39;checkbox&#39; onclick=\\"ajaxSave(&#39;" + options.rowId + "&#39;, this);\\" " + bchk + " value=&#39;" + cellvalue + "&#39; offval=&#39;no&#39; /&#62;"<br />}</p>
<p>function ajaxSave(rowid, curCheckbox) {<br />//ajax Save code <br />} <br />var mydata3 = [<br />{ RecID: "12345", AccountID: "1", EntityID: "2", YesNo: "True", Number1: "10.00", Number2: "0.00", ImportantDate: "2007-12-03" },<br />{ RecID: "23456", AccountID: "1", EntityID: "4", YesNo: "False", Number1: "2.60", Number2: "3.00", ImportantDate: "2007-12-03" },<br />{ RecID: "34567", AccountID: "2", EntityID: "3", YesNo: "True", Number1: "34.00", Number2: "3.00", ImportantDate: "2007-12-03" },<br />{ RecID: "45678", AccountID: "3", EntityID: "1", YesNo: "True", Number1: "22.00", Number2: "2.00", ImportantDate: "2007-12-03" },<br />{ RecID: "56789", AccountID: "1", EntityID: "1", YesNo: "True", Number1: "10.00", Number2: "9.00", ImportantDate: "2007-12-03" },<br />{ RecID: "67890", AccountID: "4", EntityID: "3", YesNo: "True", Number1: "1.00", Number2: "7.00", ImportantDate: "2007-12-03" },<br />{ RecID: "76543", AccountID: "3", EntityID: "3", YesNo: "True", Number1: "0.60", Number2: "10.00", ImportantDate: "2007-12-03" },<br />{ RecID: "87654", AccountID: "1", EntityID: "2", YesNo: "True", Number1: "67.00", Number2: "4.00", ImportantDate: "2007-12-03" },<br />{ RecID: "98765", AccountID: "1", EntityID: "4", YesNo: "True", Number1: "23.00", Number2: "0.09", ImportantDate: "2007-12-03" }<br />];<br />for (var i = 0; i &#60; mydata3.length; i++)<br />jQuery("#grid").addRowData(mydata3[i].id, mydata3[i]);<br />});</p>
<p>When I click onto the Account column for the first time, the dropdown is empty. When I click for the second time, it then has the values. I need it to have the values on the first click - otherwise the values are always one step behind.</p>
</p>
<p>Regards,</p>
</p>
<p>Jo</p>
]]></description>
        	        	<pubDate>Sun, 23 Aug 2009 22:36:50 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8879</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8879</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>It should work. Check your code.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Fri, 21 Aug 2009 03:26:09 +0300</pubDate>
        </item>
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8825</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8825</guid>
        	        	<description><![CDATA[<p>Tony,</p>
</p>
<p>I&#39;ve tried using the formatCell event and I get the same result. Perhaps this can&#39;t be accomplished using <span class="pln">setColProp?</span></p>
<p><span class="pln">If not how else can I redraw the select options for the cell?</span></p>
</p>
<p><span class="pln">Regards,</span></p>
</p>
<p><span class="pln">Jo</span></p>
]]></description>
        	        	<pubDate>Wed, 19 Aug 2009 19:02:04 +0300</pubDate>
        </item>
        <item>
        	<title>tony on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8793</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8793</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Use formatCell event and not <span class="pln"><span class="pun"><span class="pln">beforeEditCell -</span></span></span></p>
<p>the beforeEditCell is called after we create the element (i.e we use the colmodel), but formatCell will do the job, since it is called before creation of the element.</p>
<p>Regards</p>
<p>Tony.</p>
]]></description>
        	        	<pubDate>Wed, 19 Aug 2009 06:33:05 +0300</pubDate>
        </item>
        <item>
        	<title>jpalac on jqGrid dynamic select option</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8759</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-dynamic-select-option#p8759</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>I&#39;m creating a jqgrid with drop down columns and I&#39;m using cell editing. I need the options of the drop down columns to change dynamically and I&#39;ve tried implementing this by setting the column to be:</p>
<p><span class="pun">{</span><span class="pln"> name</span><span class="pun">:</span><span class="pln"> </span><span class="str"><span style="color: #800000;">"AccountLookup"</span></span><span class="pun">,</span><span class="pln"> index</span><span class="pun">:</span><span class="pln"> </span><span class="str"><span style="color: #800000;">"AccountLookup"</span></span><span class="pun">,</span><span class="pln"> width</span><span class="pun">:</span><span class="pln"> </span><span class="lit"><span style="color: #800000;">90</span></span><span class="pun">,</span><span class="pln"> editable</span><span class="pun">:</span><span class="pln"> </span><span class="kwd"><span style="color: #00008b;">true</span></span><span class="pun">,</span><span class="pln"> resizable<span class="pun">:</span><span class="pln"> </span><span class="kwd"><span style="color: #00008b;">true</span></span><span class="pun">,</span><span class="pln"> edittype</span><span class="pun">:</span><span class="pln"> </span><span class="str"><span style="color: #800000;">"select"</span></span><span class="pun">,</span><span class="pln"> formatter</span><span class="pun">:</span><span class="pln"> </span><span class="str"><span style="color: #800000;">"select"</span></span><span class="pln"> </span><span class="pun">},</span></span></p>
<p><span class="pln"></span></p>
<p><span class="pln"><span class="pun">and then in the beforeCellEdit event I have:</span></span></p>
<p><span class="pln"><span class="pun"><span class="pln">beforeEditCell</span><span class="pun">:</span><span class="pln"> </span><span class="kwd"><span style="color: #00008b;">function</span></span><span class="pun">(</span><span class="pln">id</span><span class="pun">,</span><span class="pln"> name</span><span class="pun">,</span><span class="pln"> val</span><span class="pun">,</span><span class="pln"> iRow</span><span class="pun">,</span><span class="pln"> iCol</span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"><br />&#160; &#160; &#160; &#160; </span><span class="kwd"><span style="color: #00008b;">if</span></span><span class="pun">(</span><span class="pln">name</span><span class="pun">==</span><span class="str"><span style="color: #800000;">&#39;AccountLookup&#39;</span></span><span class="pun">)</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> &#160; &#160; &#160; &#160; &#160; &#160; <br />&#160; &#160; &#160; &#160; &#160; &#160; </span><span class="kwd"><span style="color: #00008b;">var</span></span><span class="pln"> listdata </span><span class="pun">=</span><span class="pln"> </span><span class="typ"><span style="color: #2b91af;">GetLookupValues</span></span><span class="pun">(</span><span class="pln">id</span><span class="pun">,</span><span class="pln"> name</span><span class="pun">);</span><span class="pln"><br />&#160; &#160; &#160; &#160; &#160; &#160; </span><span class="kwd"><span style="color: #00008b;">if</span></span><span class="pln"> </span><span class="pun">(</span><span class="pln">listdata </span><span class="pun">==</span><span class="pln"> </span><span class="kwd"><span style="color: #00008b;">null</span></span><span class="pun">)</span><span class="pln"> listdata </span><span class="pun">=</span><span class="pln"> </span><span class="str"><span style="color: #800000;">"1:1"</span></span><span class="pun">;</span><span class="pln"> &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;<br />&#160; &#160; &#160; &#160; &#160; &#160; jQuery</span><span class="pun">(</span><span class="str"><span style="color: #800000;">"#grid"</span></span><span class="pun">).</span><span class="pln">setColProp</span><span class="pun">(</span><span class="pln">name</span><span class="pun">,</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> editoptions</span><span class="pun">:</span><span class="pln"> </span><span class="pun">{</span><span class="pln"> value</span><span class="pun">:</span><span class="pln"> listdata</span><span class="pun">.</span><span class="kwd"><span style="color: #00008b;">toString</span></span><span class="pun">()}</span><span class="pln"> </span><span class="pun">})</span><span class="pln"> &#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; </span><span class="pun">}</span><span class="pln"><br />&#160; &#160; </span><span class="pun">},</span><span class="pln"><br /></span></span></span></p>
<p><span class="pln"></span></p>
<p><span class="pln"><span class="pln"></span></span></p>
<p>GetLookupValues just returns a string in the format "1:One;2:Two" etc. That works fine however the options are populated one click behind - ie i click on AccountID in row 1, and the dropdown is empty, however when I then click on AccountID in row 3 the options I set in the row 1 click are shown in the row 3 click. And so on. So always one click behind.</p>
<p>Is there another way of achieving what I need? Bacially the dropdown options displayed are always changing and I need to load them as user enters the cell for editing. Perhaps I can somehow get at the select control in the beforeEditCell event and manually enter its values instead of using the setColProp call? If so could I get an example of doing that please?</p>
<p>Another thing - if the dropdown is empty and a user doesn&#39;t cancel the cell edit, the grid script throws an error. I&#39;m using clientarray editing if that makes a difference. Sometimes the dropdowns won&#39;t have any value and I need the grid to be able to accept a nothing value. I guess as a work around I can add an empty value myself so this isn&#39;t too bad, however being able to load the drop down options dynamically before user enters the cell to edit its value is critical to achieving my goal.</p>
<p>Greatly appreciate any help.</p>
<p>Regards,</p>
<p>Jo</p></p>
]]></description>
        	        	<pubDate>Tue, 18 Aug 2009 18:34:09 +0300</pubDate>
        </item>
</channel>
</rss>