<?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: Problem with dynamic combos in grid's column</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column</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/bugs/problem-with-dynamic-combos-in-grids-column/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Izaskun on Problem with dynamic combos in grid's column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16851</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16851</guid>
        	        	<description><![CDATA[<p>Hello&#160; Tony,</p>
</p>
<p>This is my code...</p>
<p>To create the grid I write:</p>
<p><span style="color: #0000ff;">&#160;&#160;&#160; plantillaGrid = $("#grid_plantilla").jqGrid({<br />&#160;&#160; &#160;&#160;&#160; &#160;url: "v93PlantillaMatHomologadosInOP.do?action=",<br />&#160;&#160; &#160;&#160;&#160; &#160;datatype: "json",<br />&#160;&#160; &#160;&#160;&#160; &#160;scroll: false,<br />&#160;&#160; &#160;&#160;&#160; &#160;rowNum:paginacionSize,&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;width: 800,<br />&#160;&#160; &#160;&#160;&#160; &#160;height: &#39;auto&#39;,&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;mtype: &#39;POST&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;colNames: [&#39;&#39;,&#39;&#39;,campo,valor,&#39;1&#39;,&#39;2&#39;,&#39;3&#39;,&#39;4&#39;,&#39;5&#39;,&#39;6&#39;,&#39;7&#39;,&#39;8&#39;,&#39;9&#39;, &#39;10&#39;],&#160;&#160; &#160;&#160;&#160; &#160;//,&#39;prueba&#39;<br />&#160;&#160; &#160;&#160;&#160; &#160;colModel: [{name:&#39;id&#39;,index:&#39;1&#39;,width:100, hidden:true},//hidden:true, , editable:false //1<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;idPlantilla&#39;,index:&#39;2&#39;, hidden:true},//hidden:true,, editable:false //2<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;campo&#39;,index:&#39;3&#39;, width:100},//3, editable: true<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; {name:&#39;valor&#39;,index:&#39;4&#39;,width:100},//4,editable: true<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;tipoDato&#39;,index:&#39;5&#39;, hidden:true},//5, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;decimales&#39;,index:&#39;4&#39;, hidden:true},//6, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;longitud&#39;,index:&#39;4&#39;, hidden:true},//7, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;tabla&#39;,index:&#39;4&#39;, hidden:true},//8, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;multiple&#39;,index:&#39;4&#39;, hidden:true},//9, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;oblig&#39;,index:&#39;4&#39;, hidden:true},//10, hidden:true &#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; {name:&#39;select&#39;,index:&#39;4&#39;, width:100, hidden:true},//11 , edittype:"select", hidden:true,editable: true, <br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;codigosCombo&#39;, hidden:true},//12, editable: true, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;check&#39;,index:&#39;4&#39;, edittype:"checkbox", hidden:true},//, editable: true, hidden:true<br />&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {name:&#39;restoCampos&#39;,index:&#39;4&#39;, hidden:true} &#160;&#160;&#160; &#160;// editable: true&#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;<br />&#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;viewrecords: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;imgpath: jsPath,<br />&#160;&#160; &#160;&#160;&#160; &#160;pager: $("#pager_grid_plantilla"),<br />&#160;&#160; &#160;&#160;&#160; &#160;cellsubmit: &#39;clientArray&#39;,&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160;&#160; editurl:&#39;<a href="http://localhost/v93War/v93MantenimientosJSP/materialesHomologados/vacia.jsp&#038;#39" rel="nofollow" target="_blank">http://localhost/v93War/v93MantenimientosJSP/materialesHomologados/vacia.jsp&#038;#39</a>;,&#160;&#160;&#160; <br />&#160;&#160; &#160;&#160;&#160; &#160;ondblClickRow: function(id){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (modoVer == false){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editarFilaPlantilla();&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; }<br />&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;});</span></p>
<p><span style="color: #0000ff;"><br />&#160;&#160; &#160;jQuery("#grid_plantilla").jqGrid(&#39;navGrid&#39;,&#39;#pager_grid_plantilla&#39;,{edit:false,add:false,del:false,search:false,refresh:false,size:50});&#160;&#160; &#160;&#160;&#160; &#160;<br />}</span></p>
</p>
<p>To complete the different combos depends the row I select I do this:</p>
<p><span style="color: #0000ff;">function editarFilaPlantilla(){<br />&#160;&#160; &#160;var numFila = plantillaGrid.getGridParam(&#39;selrow&#39;);<br />&#160;&#160; &#160;//var filaSeleccionada = $("#grid_plantilla").jqGrid(&#39;getGridParam&#39;,&#39;selrow&#39;); <br />&#160;&#160; &#160;if( numFila != null ){</span></p>
<p>&#160;&#160; &#160;&#160;&#160; &#160;var fila = plantillaGrid.getRowData(numFila);<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;//Comprobamos si el campo es obligatorio<br />&#160;&#160; &#160;&#160;&#160; &#160;var obligatorio = false;<br />&#160;&#160; &#160;&#160;&#160; &#160;if (jQuery.trim(fila[&#39;oblig&#39;]) == 1){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;obligatorio = true;<br />&#160;&#160; &#160;&#160;&#160; &#160;}&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;//Si se trata de una combo hay que rellenarla con los datos de la tabla<br />&#160;&#160; &#160;&#160;&#160; &#160;var tabla = fila[&#39;tabla&#39;];<br />&#160;&#160; &#160;&#160;&#160; &#160;if (jQuery.trim(tabla) &#38;&#38; jQuery.trim(fila[&#39;tipoDato&#39;]) == tipoCombo){<br />&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var valorescombo = $.ajax({&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;url: &#39;v93PlantillaMatHomologadosInOP.do?action=findCombo&#38;tabla=&#39;+tabla,&#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;async: false, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;success: function(data, result) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (!result) <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(&#39;Failure to retrieve the Countries.&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}).responseText;&#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;plantillaGrid.setColProp(&#39;select&#39;,&#160; {edittype:"select", display: true, hidden:false, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions: {&#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;value: valorescombo, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;multiple:true<br />&#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;<br />&#160;&#160; &#160;&#160;&#160; &#160;}</p>
<p><span style="color: #000000;"><br /></span></p>
<p><span style="color: #000000;">valorescombo: is the variable I use to recuperate the values of the different combos. Debugging the code I have found that the variable is updated correctly, but when I assign the value of "valorescombo" to the combo it only populate all right the first time, following times it gets the values of the first time, although "valorescombo" is different.</span></p>
</p>
<p>Thank you very much,</p>
</p>
<p>Izaskun</p>
</p>
<p><span style="color: #000000;"><br /></span></p>
]]></description>
        	        	<pubDate>Mon, 03 May 2010 09:22:34 +0300</pubDate>
        </item>
        <item>
        	<title>tony on Problem with dynamic combos in grid's column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16787</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16787</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>I&#39;m not sure that this is a bug. You should post your whole code or send a link to the problem.</p>
<p>There are a couple of post here regarding depended selects.</p>
</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Thu, 29 Apr 2010 11:27:08 +0300</pubDate>
        </item>
        <item>
        	<title>Izaskun on Problem with dynamic combos in grid's column</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16607</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/problem-with-dynamic-combos-in-grids-column#p16607</guid>
        	        	<description><![CDATA[<p>Hi Tony, </p>
<p>I have a grid in which a column is a dynamic combo.</p>
<p>According to the [Image Can Not Be Found]selected register, the combo will have to carry different values. <br />I&#39;ve implemented as follows:</p>
<blockquote>
<p><span style="color: #0000ff;">if (jQuery.trim(tabla) &#38;&#38; jQuery.trim(fila[&#39;tipoDato&#39;]) == tipoCombo){<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;var valorescombo = $.ajax({&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;url: &#39;v93PlantillaMatHomologadosInOP.do?action=findCombo&#38;tabla=&#39;+tabla,&#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;async: false, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;success: function(data, result) {<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;if (!result) <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;alert(&#39;Failure to retrieve the Countries.&#39;);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;}).responseText;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;plantillaGrid.setColProp(&#39;select&#39;,{edittype:"select", display: true, hidden:false, <br />&#160;&#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: valorescombo, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;multiple:true&#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;} <br />&#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;}</span></p>
</blockquote>
<p>The problem I have is that once I loaded the combo with values, not charging me with others. </p>
<p>Let me explain:</p>
<p>The first record should have a combo with the values: <br />home <br />car </p>
<p>And the combo of the second record should have the values: <br />table <br />chair </p>
<p>If I select the first record see the combo loaded with: <br />home <br />car </p>
<p>But then I select the second record, although I receive are the values with which I have to upload (table, chair), I always carry the values of the first combo that I opened (home, car). </p>
<p>How could I fix it?</p>
</p>
<p>Thank you very much,</p>
</p>
<p>Izaskun</p>
]]></description>
        	        	<pubDate>Thu, 22 Apr 2010 20:44:29 +0300</pubDate>
        </item>
</channel>
</rss>