<?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: inline edit and select type</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type</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/inline-edit-and-select-type/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19687</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19687</guid>
        	        	<description><![CDATA[<p>Hello TomaÅ¾,</p>
<p>in my email I wrote "column &#39;category_entity_id&#39; has index&#160;<strong>i_category_entity_id</strong>&#160;(it seems 1 in your colModel)". You just miss the information. So you should either replace <strong>cm[i_category_entity_id]</strong>&#160;to <strong>cm[1]</strong>. or define somewhere in your code <strong>var </strong><strong>i_category_entity_id=1</strong>.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Sat, 11 Sep 2010 10:45:30 +0300</pubDate>
        </item>
        <item>
        	<title>cyracks on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19681</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19681</guid>
        	        	<description><![CDATA[<div>Oleg thanks for the help, much appreciated. You probably saved me hours of testing <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></div>
<blockquote>
<div>I am not sure that I full understand what you want. So I write two main problems which I see</div>
<ol>
<li>You choose on the server side ids of the rows in a complex way and the values have special characters </li>
<li>The dataUrl of the &#39;category_entity_id&#39; column should contain the value from the &#39;supplier_short_name&#39; column from the same row. </li>
</ol>
</blockquote>
<p>Yes you are correct, that was my probem, but thanks to you it is almost solved <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<blockquote>
<ul>
<li>make a simple ids </li>
<li>if you have two grids on the same page don&#39;t use the same ids </li>
<li>don&#39;t use for other elements on the page the same ids which could be returned from the server as rowIds </li>
</ul>
</blockquote>
<p>Make simple ids &#8211; of course I don&#39;t know why I was thinking that id of row must be made from columns which are unique in sql table. <br />( This is my first javascript/jquery/jqgrid program, so maby to much information at once <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /> &#160;&#160;</p>
<blockquote>
<p>To your main problem. It seems that your problem is not so difficult to solve. Somewhere, typically inside of onSelectRow or ondblClickRow, so you have <strong>rowId</strong>, you call editRow function. I suggest that <strong>before</strong> the call of editRow you change dataUrl of the &#39;category_entity_id&#39; column. Let us the column &#39;category_entity_id&#39; has index <strong>i_category_entity_id</strong> (it seems 1 in your colModel).&#160;You can do something like following</p>
<p>var myGrid = jQuery("#link_categories");<br />var newUrl&#160;= &#39;link_categories.php?oper=grid_lookup_category_entity_id&#38;value=&#39; +<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;encodeURIComponent(myGrid.getCell(<strong>rowId</strong>,&#39;supplier_short_name&#39;));<br />var cm = myGrid.getGridParam("colModel");</p>
<p>jQuery.extend(cm[<strong>i_category_entity_id</strong>], {&#160;editoptions: {dataUrl: newUrl}});</p>
</blockquote>
<p>I tryed suggested code but it is returning error: <strong>i_category_entity_id is not defined. </strong>Even if index is changet to <strong>category_entity_id </strong>so it is the same as column name, the same type of error is shown. Definition of the column is</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3466' value='Select Code' data-codeid='sfcode3466' /></p>
<div class='sfcode' id='sfcode3466'>{<strong>name</strong>:&#39;category_entity_id&#39;,editable: true, formatter:&#39;select&#39;, search: true,&#160;<br /><strong>&#160;&#160;&#160;&#160;&#160; </strong>edittype:&#34;select&#34;,<strong>index</strong>:&#39;i_category_entity_id&#39;&#8230;<strong><br /></strong></div>
</p>
<p>I also tryed to put the code below to&#160;onSelectRow event (before I call editRow) and&#160;dataEvent&#160;type &#39;click&#39;, but despite the fact, that dropdown is&#160;filled correctly, the value in column is reseted to the first value in select.<br />Example: drop down values are 1,2 and 3. Current value is set to 3, but when row goes into edit mode the value is reseted to 1 (because 1 in the first place of dropdown menu)</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1220' value='Select Code' data-codeid='sfcode1220' /></p>
<div class='sfcode' id='sfcode1220'>var rowid = $(&#34;#link_categories&#34;).jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />var supplier_short_name = $(&#34;#link_categories&#34;).jqGrid(&#39;getCell&#39;,rowId,&#39;supplier_short_name&#39;)<br />$.get(&#39;link_categories.php?oper=grid_lookup_category_entity_id&#38;value=&#39;+supplier_short_name<br />&#160;&#160;&#160; ,function(data){<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; var res = $(data).html();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(&#34;#&#34;+ rowid +&#34;_category_entity_id&#34;).html(res);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; // $(&#34;#category_entity_id&#34;).html(res);<br />&#160;&#160;&#160; }<br />);</div>
</p>
<p>Belo is the whole code:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit5059' value='Select Code' data-codeid='sfcode5059' /></p>
<div class='sfcode' id='sfcode5059'>
<p>// We use a document ready jquery function.<br />jQuery(document).ready(function(){<br />var lastsel;<br />jQuery(&#34;#link_categories&#34;).jqGrid({<br />&#160;&#160;&#160; <a href=&#34;/blog/&#34;/blog/&#34;/blog/&#34;http:/www.trirand.com/blog/&#39;link_categories.php?nd=&#39;+new&#34;&#34;&#34;&#34; target=&#34;&#34;&#34;_blank&#34;&#34;&#34; target="_blank">url:&#39;link_categories.php?nd=&#39;+new</a> Date().getTime()+&#39;&#38;grid_name=link_categories&#39;,<br />&#160;&#160;&#160; editurl: &#34;link_categories.php&#34;,<br />&#160;onSelectRow: function(rowId){<br />&#160;if(rowId &#38;&#38; rowId!==lastsel){<br />&#160;&#160;&#160;jQuery(&#39;#link_categories&#39;).jqGrid(&#39;saveRow&#39;,lastsel);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var myGrid = jQuery(&#34;#link_categories&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var newUrl = &#39;link_categories.php?oper=grid_lookup_category_entity_id&#38;value=&#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; encodeURIComponent(myGrid.getCell(rowId,&#39;supplier_short_name&#39;));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cm = myGrid.getGridParam(&#34;colModel&#34;);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <strong>jQuery.extend(cm[i_category_entity_id], { editoptions: {dataUrl: newUrl}});</strong><br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;jQuery(&#39;#link_categories&#39;).jqGrid(&#39;editRow&#39;,rowId,true);<br />&#160;&#160;&#160;lastsel=rowId;<br />&#160;&#160;}<br />&#160;},<br />&#160;&#160;&#160; datatype: &#34;json&#34;,<br />&#160;&#160;&#160; colModel:[<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;supplier_short_name&#39;, index:&#39;supplier_short_name&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editable: true, width:120, resizable:true, sorttype:&#34;text&#34;, // formatter:&#39;select&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#34;select&#34;, editrules:{required:true}, formatter:&#39;select&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions:{ <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value:&#34;1:A;2:B;2:C;4:D&#34;,<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;category_entity_id&#39;,editable: true, formatter:&#39;select&#39;, search: true, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; edittype:&#34;select&#34;,index:&#39;i_category_entity_id&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; editoptions:{ <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; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; dataUrl:&#39;link_categories.php?oper=grid_lookup_category_entity_id&#39;, <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value: getSequenceNumbers(),&#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; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; },&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; pager: jQuery(&#39;#link_categories_footer&#39;),<br />&#160;&#160;&#160; rowNum:20,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; sortorder: &#34;desc&#34;,<br />&#160;&#160;&#160; height: 250,<br />});<br />jQuery(&#34;#link_categories&#34;).jqGrid(&#39;filterToolbar&#39;);<br />jQuery(&#34;#link_categories&#34;).jqGrid(&#39;navGrid&#39;,&#34;#link_categories_footer&#34;,{edit:true,add:true,del:true});</p>
<p>function getSequenceNumbers(){<br />&#160;&#160;&#160; return &#34;0:ValueA;1:ValueB;2:ValueC;3:ValueE;4:ValueE;5:ValueF;6:ValueG;7:ValueH&#34;;<br />}<br />});</p>
</div>
<p>Regards, TomaÅ¾</p>
]]></description>
        	        	<pubDate>Sat, 11 Sep 2010 03:53:29 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19643</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19643</guid>
        	        	<description><![CDATA[<div>Hi TomaÅ¾,</div>
<div>I am not sure that I full understand what you want. So I write two main problems which I see</div>
<div>
<ol>
<li>You choose on the server side ids of the rows in a complex way and the values have special characters</li>
<li>The dataUrl of the &#39;category_entity_id&#39; column should contain the value from the &#39;supplier_short_name&#39; column from the same row.</li>
</ol>
</div>
<p>To the first problem. It is bad if you use complex method to build rowIds and it is very bad if they have come exotic characters. You should understand that rowIds will be used as ids of HTML elements of row (&#60;tr&#62; elements). A lot of code can work incorrect if you place any characters inside the id. For example if you have "bla td" as id and inside of jqGrid code will be used jQuery(&#39;#&#39;+ rowId) then one receive jQuery(&#39;#bla td&#39;) which will be interpret as selector of td element which is child of the element with id &#39;bla&#39;. jqGrud try to eliminate some problems with special characters in rowIds normalizing ids with respect of <a href="/jqgridwiki/doku.php?id=wiki:methods" target="_blank">$.jgrid.jqID</a>&#160;function, but it solve not all possible problems.&#160;So</p>
<ul>
<li><span style="font-size: 14.1667px;">make a simple ids</span></li>
<li><span style="font-size: 14.1667px;">if you have two grids on the same page don&#39;t use the same ids</span></li>
<li>don&#39;t use for other elements on the page the same ids which could be returned from the server as rowIds</li>
</ul>
<p>To your main problem. It seems that your problem is not so difficult to solve. Somewhere, typically inside of onSelectRow or ondblClickRow, so you have <strong>rowId</strong>, you call editRow function. I suggest that <strong>before</strong> the call of editRow you change dataUrl of the &#39;category_entity_id&#39; column. Let us the column &#39;category_entity_id&#39; has index <strong>i_category_entity_id</strong> (it seems 1 in your colModel).&#160;You can do something like following</p>
<p>var myGrid = jQuery("#link_categories");<br />var newUrl&#160;= &#39;link_categories.php?oper=grid_lookup_category_entity_id&#38;value=&#39; +<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;encodeURIComponent(myGrid.getCell(<strong>rowId</strong>,&#39;supplier_short_name&#39;));<br /><span style="font-size: 14.1667px;">var cm = myGrid.getGridParam("colModel");</span></p>
<p>jQuery.extend(cm[<strong>i_category_entity_id</strong>], {&#160;editoptions: {dataUrl: newUrl}});</p>
</p>
<p><span style="font-size: 14.1667px;">Best regards</span></p>
<p>Oleg&#160;</p>
]]></description>
        	        	<pubDate>Fri, 10 Sep 2010 04:10:25 +0300</pubDate>
        </item>
        <item>
        	<title>cyracks on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19641</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19641</guid>
        	        	<description><![CDATA[<p>First of, thank you for replying to my post, I am bashing my head against the wall for two days with this problem.<br />I will try to explane better.</p>
<p>When grid is in edit mode I would like to select value of column A ( edittype : select ) when inside dataEvent &#39;click&#39; in column B ( column goes into inline edit mode on row select)<br />ColModel&#160;definition of column A (supplier_short_name) and column B (category_entity_id).</p>
<p><input type='button' class='sfcodeselect' name='sfselectit9146' value='Select Code' data-codeid='sfcode9146' /></p>
<div class='sfcode' id='sfcode9146'>colModel:[<br />{name:&#39;supplier_short_name&#39;,index:&#39;supplier_short_name&#39;,editable: true,&#160;edittype:&#34;select&#34;,formatter:&#39;select&#39;},<br />{name:&#39;category_entity_id&#39;,editable: true, formatter:&#39;select&#39;, search: true,&#160;edittype:&#34;select&#34;,<br /><span style=&#34;&#34;white-space:pre&#34;&#34;> </span>editoptions:{&#160;dataEvents :[{type: &#39;click&#39;...</div>
<p>If I try to get the value the jqgrid way</p>
<p><input type='button' class='sfcodeselect' name='sfselectit6721' value='Select Code' data-codeid='sfcode6721' /></p>
<div class='sfcode' id='sfcode6721'>var rowid = $(&#34;#link_categories&#34;).jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />var row_values = jQuery(&#34;#link_categories&#34;).jqGrid(&#39;getRowData&#39;,rowid);&#160;</div>
<p>I get html string despite the fact that formatter of column A is set to select (&#160;<strong>formatter:&#39;select&#39;).&#160;</strong>So instead the value of the column I get html construct of the column ( &#60;select class= .... &#60;/select&#62;)<br />So the only solution is to get the value with direct jquery&#160;request which is</p>
<p><input type='button' class='sfcodeselect' name='sfselectit2538' value='Select Code' data-codeid='sfcode2538' /></p>
<div class='sfcode' id='sfcode2538'>var rowid = $(&#34;#link_categories&#34;).jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />jQuery(&#34;#&#34; + (rowId) + &#34;_supplier_short_name&#34;)[0].value</div>
<p>The rowid in my case is defined by values in 3 different columns. Values are not just numbers but can be anything. That is defined in php script:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7490' value='Select Code' data-codeid='sfcode7490' /></p>
<div class='sfcode' id='sfcode7490'>while($row = mysql_fetch_array($result,MYSQL_ASSOC)) {<br /><span style=&#34;&#34;white-space:pre&#34;&#34;> </span><strong>$responce-&#62;rows[$i][&#39;id&#39;] = </strong><span style=&#34;&#34;white-space:pre&#34;&#34;> </span>array($row[supplier_short_name],$row[supplier_category],$row[category_entity_id]);&#160;<br /><span style=&#34;&#34;white-space:pre&#34;&#34;> <br /></span><span style=&#34;&#34;white-space:pre&#34;&#34;> </span>$responce-&#62;rows[$i][&#39;cell&#39;] = <span style=&#34;&#34;white-space:pre&#34;&#34;> </span>array($row[supplier_short_name],$row[supplier_category],$row[category_entity_id],$row[attribute_set_id],$row[adTimeIns],$row[adTimeChg]);&#160;<br /><span style=&#34;&#34;white-space:pre&#34;&#34;> </span>$i++;&#160;<br />}<br />echo json_encode($responce);&#160;</div>
<p>When jqgid is constructed the id of a column is <span style="text-decoration: underline;">#</span><strong><span style="text-decoration: underline;">RowId</span></strong><span style="text-decoration: underline;">_ColumnName</span> where <strong>RowId</strong> is not just a number but combined value of 3 columns ( user input values which I can not control )</p>
<p>So my question is which function encodes the string <strong>value_in_column_1,value_in_column_2,value_in_column_3 </strong>to an id of the row?</p>
<p>Example:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1933' value='Select Code' data-codeid='sfcode1933' /></p>
<div class='sfcode' id='sfcode1933'>var rowid = 1;<br />jQuery(&#34;#&#34; + (rowId) + &#34;_supplier_short_name&#34;)[0].value&#160;&#160;- <strong>value found</strong></p>
<p>var rowid = &#39;j, sdf Ä 34#$&#39;2&#39; 46&#38;&#38;&#39;;<br />jQuery(&#34;#&#34; + (rowId) + &#34;_supplier_short_name&#34;)[0].value&#160;&#160;- <strong>value NOT found, returns undefined error</strong></p>
</div>
<p>regards, TomaÅ¾</p>
]]></description>
        	        	<pubDate>Fri, 10 Sep 2010 01:49:54 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19637</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19637</guid>
        	        	<description><![CDATA[<p>Sorry but I not really understand your question. You posted code without enough description what you want&#160;achieve&#160;with the code.</p>
<p>The names on jqGrid columns you define yourself to use it in the JavaScript only. If you have some problems with long names included special characters why you not just choose more simple names for the columns?</p>
<p>If you want to build ids used by jqGrid you should use <a href="/jqgridwiki/doku.php?id=wiki:methods#common_functions_and_settings" target="_blank">$.jgrid.jqID</a> function.</p>
<p>Best regards<br />Oleg</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 22:17:13 +0300</pubDate>
        </item>
        <item>
        	<title>cyracks on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19635</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19635</guid>
        	        	<description><![CDATA[<p>The problem why I can&#39;t get value using jquery is because the definition of id of the column:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit1189' value='Select Code' data-codeid='sfcode1189' /></p>
<div class='sfcode' id='sfcode1189'>
<p>var rowid = $(&#34;#link_categories&#34;).jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />jQuery(&#34;#&#34; + (rowId-1) + &#34;_supplier_short_name&#34;)[0].value&#160;&#160;</p>
</div>
<p>RowId is not just a simple number, but string combined from 3 columns which can contain non standard characters. </p>
<p>ie:&#160;<strong>&#39;#Field_1_Field_2_Field_3_Column_name&#39;</strong> where Field_1 is <strong>"stra#+ n &#8211; ge Äar"</strong></p>
<p>The definition from php file:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit297' value='Select Code' data-codeid='sfcode297' /></p>
<div class='sfcode' id='sfcode297'>
<p>$responce-&#62;rows[$i][&#39;id&#39;] = array($row[supplier_short_name],$row[supplier_category],$row[category_entity_id]);</p>
</div>
<p>My question is how to escape these strange characters that will mathc jqgrid definition ( ie: that I will get the same string for column id as jqgrid ). I tryed javascript <strong>encodeURIComponent</strong>(rowid) function but it is not working (my knowledge of javascript is very limited:(</p></p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 19:07:07 +0300</pubDate>
        </item>
        <item>
        	<title>cyracks on inline edit and select type</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19618</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/inline-edit-and-select-type#p19618</guid>
        	        	<description><![CDATA[<p>How can I retrive just a column ID from column A when inside event of column B. Type of column A is select and editing is inline. I know that similar question was asked a couple of times but I can&#39;t find a solution nomather what I try I always get html construct.</p>
</p>
<p>This returns html construct: &#60;select class= &#8230;<br />var rowid = $("#link_categories").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />var row_values = jQuery("#link_categories").jqGrid(&#39;getRowData&#39;,rowid);</p>
</p>
<p>This returns undefined error<br />jQuery("#" + (rowId-1) + "_supplier_short_name")[0].value&#160;</p>
</p>
<p>// &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#160; &#160;grid definition &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>jQuery(document).ready(function(){</p>
<p>jQuery("#link_categories").jqGrid({<br />&#160;&#160; &#160;colModel:[<br />&#160;&#160; &#160; &#160; &#160;{name:&#39;supplier_short_name&#39;, index:&#39;supplier_short_name&#39;, editable: true,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;edittype:"select", editrules:{required:true}, formatter:&#39;select&#39;,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;editoptions:{ value:"1:A;2:B;3:C;4:D"}},<br />&#160;&#160; &#160; &#160; &#160;{name:&#39;category_entity_id&#39;,editable: true, formatter:&#39;select&#39;, search: true,&#160;edittype:"select",<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160;editoptions:{<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;dataUrl:&#39;link_categories.php?oper=grid_lookup_category_entity_id&#39;,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;value:{0:&#39;A&#39;,1:&#39;B&#39;},<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;dataEvents :[{<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;type: &#39;click&#39;,<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;fn: function(e){<br /><strong>&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var rowid = $("#link_categories").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;);<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var row_values = jQuery("#link_categories").jqGrid(&#39;getRowData&#39;,rowid);&#160;<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;// var supplier_short_name = $(&#39;#&#39; + rowid + &#39;_supplier_short_name&#39;).val();&#160;<br /></strong><span style="white-space: pre;"> </span>//&#160;alert(supplier_short_name)<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$.get(&#39;link_categories.php?oper=grid_lookup_category_entity_id&#38;value=&#39;+row_values[&#39;supplier_short_name&#39;]<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;,function(data){&#160;<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;var res = $(data).html();&#160;<br />&#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;$("#category_entity_id").html(res);<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;}<br />onSelectRow: function(id){<br />if(id &#38;&#38; id!==lastsel){&#160;<br /><span style="white-space: pre;"> </span>jQuery(&#39;#link_categories&#39;).jqGrid(&#39;saveRow&#39;,lastsel);&#160;<br /><span style="white-space: pre;"> </span>jQuery(&#39;#link_categories&#39;).jqGrid(&#39;editRow&#39;,id,true);&#160;<br /><span style="white-space: pre;"> </span>lastsel=id;&#160;</p>
<p>});	},		}</p>
]]></description>
        	        	<pubDate>Thu, 09 Sep 2010 02:12:39 +0300</pubDate>
        </item>
</channel>
</rss>