<?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: trying to create to dependant dropdowns</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns</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/trying-to-create-to-dependant-dropdowns/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>balderas on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8943</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8943</guid>
        	        	<description><![CDATA[<p>Hola Juan:</p>
</p>
<p>Tengo un jQGrid donde quiero&#160;enlazar&#160;dos combos (pais, estado),&#160; es decir que al seleccionar pais me proporcione el estado.</p>
</p>
<p>He intentado con lo siguiente<span style="font-size: x-small;"></span></p>
<p align="left">&#160;</p>
<p align="left">&#160;</p>
<p align="left"><span style="font-size: x-small;">name:&#39;id_pais&#39;, <br />index:&#39;id_pais&#39;,<br />align:"right",<br />width:250,<br />editable:true,<br />edittype:"select",<br />editoptions:{value:fRellenarComboPais(),<br />dataEvents:[{type:&#39;change&#39;,fn:function(e){<br />var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />var pais = e.currentTarget.value;<br />var estados = $.ajax({<br />url: &#39;&#60;%=request.getContextPath()%&#62;/combos.do?reqCode=llenarComboEstado&#38;pais=&#39;+pais,<br />async: false}).responseText;<br />//alert(municipios);<br />jQuery("#list").setColProp(&#39;id_estado&#39;,{editoptions: {value: estados}});<br />}}]},<br />editrules:{edithidden:true,required:true,number:true}<br />}, { <br />name:&#39;id_estado&#39;,<br />index:&#39;id_estado&#39;,<br />align:"right",<br />width:250,<br />editable:true,<br />edittype:"select",<br />//editoptions:{value:&#39;&#39;,defaultValue:&#39;1&#39;},<br />editrules:{edithidden:true,required:true,number:true}<br />}</span></p>
</p>
<p>Pero al dar click sobre el pais no me despliega nada en estados.</p>
</p>
<p>Gracias de antemano&#160;</p>
]]></description>
        	        	<pubDate>Mon, 24 Aug 2009 12:31:38 +0300</pubDate>
        </item>
        <item>
        	<title>tony on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8626</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8626</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks. The problem lie that we use ajax call and it is unknown when this call ends. Since of this all the other processes continue and it is quite possible of loss of information.</p>
<p>Instead will try to overcome this.</p>
<p>Regards</p>
<p>Tony</p>
]]></description>
        	        	<pubDate>Sat, 15 Aug 2009 02:57:21 +0300</pubDate>
        </item>
        <item>
        	<title>Juan on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8594</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8594</guid>
        	        	<description><![CDATA[<p>thanks John, I&#180;ll take it in to account</p>
]]></description>
        	        	<pubDate>Fri, 14 Aug 2009 14:09:11 +0300</pubDate>
        </item>
        <item>
        	<title>John Teague on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8593</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8593</guid>
        	        	<description><![CDATA[<p>One item of note: If you are calling dataUrl: to use server side to create the select, and dataEvents: to perform, say for example, an onchange function, make sure you set dataEvents first in your editOptions:</p>
<p>{name:&#39;assigned_to_id&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; index:&#39;assigned_to_id&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; width:80, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; align:&#39;center&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; sortable:true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; editable:true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; edittype:&#39;select&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160; editoptions:{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; dataEvents: [{ type: &#39;change&#39;, fn: function(e) {change_assigned_to();}}],<br />&#160;&#160; &#160;&#160;&#160; &#160; &#160; &#160;&#160; dataUrl:&#39;someurl.php&#39;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }, <br />}</p>
<p>Otherwise, at least for me, the grid fails to load without error. Anyone else out there let me know if I am mistaken here.</p></p>
]]></description>
        	        	<pubDate>Fri, 14 Aug 2009 12:32:00 +0300</pubDate>
        </item>
        <item>
        	<title>Juan on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8029</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8029</guid>
        	        	<description><![CDATA[<p>well, for now I endup doing this:</p>
<p>&#160;&#160;&#160;&#160;&#160; {name:&#39;nivel&#39;, index:&#39;n.nombre&#39;, width:100, editable:true, edittype: &#39;select&#39;,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value:niveles,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; attr: { title: &#39;Nivel&#39; },<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; dataEvents: [<br />&#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;&#160;&#160; &#160;var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; var nivel = e.currentTarget.value;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.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; url: &#39;/iae/index.php?r=curso/getCursosOptions&#38;nivel=&#39;+nivel,<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; async: false}).responseText;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#&#39;+gr+&#39;_curso&#39;).html(cursos);<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; }<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ]<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</p>
<p>now it works, but have to do two diferent server actions, one with the select and options tags for the onchange and one with only the values for the onSelectRow, but it works!!! and I&#39;m hapy <img class="wp-smiley" src="/blog/wp-includes/images/smilies/icon_smile.gif" alt=":)" /></p>
<p>I&#39;m a newbe with jqgrid, jquery, javascript and php, so&#8230;. please if you drop by and have a little time help me with some advice on how improbe my code, I want to learn all of this quick!!</p>
<p>Below I post all the code, with the server code to, just in case someone may need it or someone just want to help me to improve it</p>
<p>Thanks</p>
</p>
<p>/*</p>
<p>* client code</p>
<p>*/</p>
<p>jQuery(document).ready(function(){</p>
<p>&#160; var niveles = $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; url: &#39;/iae/index.php&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; data:&#39;r=nivel/getNiveles&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />//&#160; console.log(niveles);<br />//&#160; var niveles = &#39;1:one;2:two;5:cinco&#39;;<br />&#160; var lastsel;<br />&#160;&#160;&#160; <br />&#160; jQuery("#list").jqGrid({<br />&#160;&#160;&#160; url:&#39;/iae/index.php?r=trabajo/getTrabajos&#39;,<br />&#160;&#160;&#160; datatype:&#39;json&#39;,<br />&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160; width: 300,<br />&#160;&#160;&#160; height:200,<br />&#160;&#160;&#160; colNames:[&#39;ID&#39;,&#39;Nombre&#39;,&#39;id_nivel&#39;,&#39;Nivel&#39;,&#39;Curso&#39;],<br />&#160;&#160;&#160; colModel :[<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;id&#39;, index:&#39;t.id&#39;, width:65, hidden:true, editable:true},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;nombre&#39;, index:&#39;t.nombre&#39;, search: false,width:100, editable:true },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;id_nivel&#39;, index:&#39;n.id&#39;, hidden:true, search: false,width:100, editable:true },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;nivel&#39;, index:&#39;n.nombre&#39;, width:100, editable:true, edittype: &#39;select&#39;,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value:niveles,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; attr: { title: &#39;Nivel&#39; },<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; dataEvents: [<br />&#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;&#160;&#160; &#160;var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;var ret = jQuery("#list").getRowData(gr);<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var nivel = e.currentTarget.value;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.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; url: &#39;/iae/index.php?r=curso/getCursosSelect&#38;nivel=&#39;+nivel,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;#&#39;+gr+&#39;_curso&#39;).parent().html(cursos);<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; }<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ]<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;curso&#39;, index:&#39;c.nombre&#39;, edittype: &#39;select&#39;, width:100, editable:true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; beforeEditCell: function (e){<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; console.log(e);<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;&#160; dataEvents: [<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; { 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; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var gr = jQuery("#list").getGridParam(&#39;selrow&#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;var ret = jQuery("#list").getRowData(gr);<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;var nivel = e.currentTarget.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; console.log(e);<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; var a =jQuery("#list").getColProp(&#39;curso&#39;,&#39;editoptions&#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; console.log(a);<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; }<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; }<br />&#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; attr: {title:&#39;Some title&#39;}<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; loadComplete: function()&#160;&#160;&#160; {<br />//&#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list&#39;).setColProp(&#39;nivel&#39;,{editoptions:{value:niveles}});<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; onSelectRow: function(id){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastsel){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var ret = jQuery("#list").getRowData(id);<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url: &#39;/iae/index.php&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; data: &#39;r=curso/getCursos&#38;nivel=&#39;+ret.id_nivel,<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#list").setColProp(&#39;curso&#39;,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; {editoptions: {value: cursos}});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).restoreRow(lastsel);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).editRow(id,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; lastsel=id;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;#cancel&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160; autowidth:true,<br />&#160;&#160;&#160; rowList:[10,20,30,100],<br />&#160;&#160;&#160; sortname: &#39;t.nombre&#39;,<br />&#160;&#160;&#160; sortorder: "asc",<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; gridview: true,<br />&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160; rownumWidth: 40,<br />&#160;&#160;&#160; editurl: &#39;/iae/index.php?r=trabajo/editTrabajo&#39;,<br />&#160;&#160;&#160; caption: &#39;Trabajos&#39;<br />&#160; });<br />})<br />&#160; jQuery.fn.log = function (msg) {<br />&#160;&#160;&#160;&#160;&#160; console.log("%s: %o", msg, this);<br />&#160;&#160;&#160;&#160;&#160; return this;<br />&#160; };<br />&#160; $("#edit").click(function(){<br />&#160;&#160;&#160; &#160; var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery("#list").editGridRow(gr,{recreateForm: true,closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; //jQuery("#list").editRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160; &#160; }<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert("No hay ningun registro seleccionado");<br />&#160;&#160;&#160; &#160;&#160; });<br />&#160; $("#cancel").click(function(){<br />&#160;&#160;&#160; &#160; var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery("#list").restoreRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#cancel&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160; }<br />//&#160;&#160;&#160; &#160; jQuery("#list").editGridRow(gr,{closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert("No hay ningun registro seleccionado");<br />&#160;&#160;&#160; &#160;&#160; });<br />&#160; $("#save").click(function(){<br />&#160;&#160;&#160; &#160; var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery("#list").saveRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#cancel&#39;).attr(&#39;disabled&#39;,true);<br />//&#160;&#160;&#160; &#160; jQuery("#list").editGridRow(gr,{closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160; }<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert("No hay ningun registro seleccionado");<br />&#160;&#160;&#160; &#160;&#160; });<br />&#60;/script&#62;</p>
<p>/*</p>
<p>/ server code</p>
<p>*/</p>
<p>&#160;&#160;&#160; public function actionGetNiveles()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = Nivel::model()-&#62;findAll();<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = CHtml::listData($Niveles, &#39;id&#39;,&#39;nombre&#39;);<br />//&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;select&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />//&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;option value=&#39;. $id .&#39;&#62;&#39;.$nombre.&#39;&#60;/option&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; }<br />//&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;/select&#62;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; $sel =&#160; &#39;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; $i = 0;<br />&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $sel .= $id .&#39;:&#39;.$nombre;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if (++$i &#60; sizeof($Niveles))<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$sel .= &#39;;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; echo $sel;<br />//&#160;&#160;&#160; $sel = copy($sel,0,length($sel)-1);<br />&#160;&#160;&#160; &#160;&#160;&#160; <br />&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; public function actionGetCursos()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = Curso::model()-&#62;findAll(&#39;id_nivel=:parent_id&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; array(&#39;:parent_id&#39;=&#62;(int) $_GET[&#39;nivel&#39;]));<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = CHtml::listData($Niveles, &#39;id&#39;,&#39;nombre&#39;);<br />//&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;select&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />//&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;option value=&#39;. $id .&#39;&#62;&#39;.$nombre.&#39;&#60;/option&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; }<br />//&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;/select&#62;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; $sel =&#160; &#39;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; $i = 0;<br />&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; $sel .= $id .&#39;:&#39;.$nombre;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; if (++$i &#60; sizeof($Niveles))<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$sel .= &#39;;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; echo $sel;<br />&#160;&#160;&#160; }<br />&#160;&#160;&#160; public function actionGetCursosSelect()<br />&#160;&#160;&#160; {<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = Curso::model()-&#62;findAll(&#39;id_nivel=:parent_id&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; array(&#39;:parent_id&#39;=&#62;(int) $_GET[&#39;nivel&#39;]));<br />&#160;&#160;&#160; &#160;&#160;&#160; $Niveles = CHtml::listData($Niveles, &#39;id&#39;,&#39;nombre&#39;);<br />//&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;select&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />//&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;option value=&#39;. $id .&#39;&#62;&#39;.$nombre.&#39;&#60;/option&#62;&#39;;<br />//&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;select&#62;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; foreach($Niveles as $id =&#62; $nombre){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;option value="&#39;.$id .&#39;"&#62;&#39;.$nombre.&#39;&#60;/option&#62;&#39;;<br />&#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &#160;&#160;&#160; echo &#39;&#60;/select&#62;&#39;;<br />&#160;&#160;&#160; }</p>
]]></description>
        	        	<pubDate>Sun, 26 Jul 2009 17:36:58 +0300</pubDate>
        </item>
        <item>
        	<title>Juan on trying to create to dependant dropdowns</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8028</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/trying-to-create-to-dependant-dropdowns#p8028</guid>
        	        	<description><![CDATA[<p>Hi all.</p>
<p>I have a grid with one lookup, &#39;niveles&#39;, that has a descendant lookup, &#39;cursos&#39;, when the user select from the &#39;niveles&#39; lookup the data in the &#39;cursos&#39; lookup mast be actualized. This is what I tried so far:</p>
<p>In the onSelectRow it works fine, the only thing here that&#160; bothers me is that I can&#39;t get the id of &#39;nivel&#39;, don&#39;t know how, instead, I&#39;m using &#39;id_nivel&#39;, a hidden column only for this.</p>
<p>// The code so far</p>
<p>//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />&#160;&#160;&#160; onSelectRow: function(id){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastsel){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var ret = jQuery(&#8221;#list&#8221;).getRowData(id);<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url: &#39;/iae/index.php?r=curso/getCursos&#38;nivel=&#39;+ret.id_nivel,<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#8221;#list&#8221;).setColProp(&#39;curso&#39;,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; {editoptions: {value: cursos}});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).restoreRow(lastsel);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).editRow(id,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; lastsel=id;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;#cancel&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; },<br />//&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Then I&#39;m tring to get the data for the descendant lookup when the user changes the master data, &#39;niveles&#39;, but can&#39;t get it to work, this is the last code I tried:</p>
<p>&#160;&#160;&#160;&#160; {name:&#39;nivel&#39;, index:&#39;n.nombre&#39;, width:100, editable:true, edittype: &#39;select&#39;,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value:niveles,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; attr: { title: &#39;Nivel&#39; },<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; dataEvents: [<br />&#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;&#160;&#160; var nivel = e.currentTarget.value;<br />&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160; var cursos = $.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; url: &#39;/iae/index.php?r=curso/getCursos&#38;nivel=&#39;+nivel,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#list").setColProp(&#39;curso&#39;,{editoptions: {value: cursos}});</p>
<p>&#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; }<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ]<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; },</p>
<p>but with not success</p>
<p>Well thanks a lot for reading this post and maibe someone else had problems with this like me, below I drop the code in case you want to see what is wrong<br />(sorry for my english!)</p>
<p>&#60;?php<br />&#160;&#160;&#160; $this-&#62;widget(&#39;application.components.Grid&#39;,array(&#39;items&#39;=&#62;array(&#39;theme&#39;=&#62;&#39;vader&#39;),));<br />?&#62;</p>
<p>&#60;table id=&#8221;list&#8221; class=&#8221;scroll&#8221; cellpadding=&#8221;0&#8243; cellspacing=&#8221;0&#8243;&#62;&#60;/table&#62;<br />&#60;div id=&#8221;pager&#8221; class=&#8221;scroll&#8221; style=&#8221;text-align:center;&#8221;&#62;&#60;/div&#62;<br />&#60;input type=&#8221;BUTTON&#8221; id=&#8221;edit&#8221; value=&#8221;Edit Selected&#8221; /&#62;<br />&#60;input type=&#8221;BUTTON&#8221; id=&#8221;save&#8221; disabled=&#8221;disabled&#8221; value=&#8221;Save Selected&#8221; /&#62;<br />&#60;input type=&#8221;BUTTON&#8221; id=&#8221;cancel&#8221; disabled=&#8221;disabled&#8221; value=&#8221;Cancel Selected&#8221; /&#62;</p>
<p>&#60;script type=&#8221;text/javascript&#8221;&#62;<br />jQuery(document).ready(function(){<br />&#160;&#160;&#160; <br />&#160; var niveles = $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160; url: &#39;/iae/index.php?r=nivel/getNiveles&#39;,<br />&#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160; console.log(niveles);<br />&#160; //niveles = &#39;1:one;2:two;5:cinco&#39;;<br />&#160; var lastsel;<br />&#160;&#160;&#160; <br />&#160; jQuery(&#8221;#list&#8221;).jqGrid({<br />&#160;&#160;&#160; url:&#39;/iae/index.php?r=trabajo/getTrabajos&#39;,<br />&#160;&#160;&#160; datatype:&#39;json&#39;,<br />&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160;&#160; width: 300,<br />&#160;&#160;&#160; height:200,<br />&#160;&#160;&#160; colNames:[&#39;ID&#39;,&#39;Nombre&#39;,&#39;id_nivel&#39;,&#39;Nivel&#39;,&#39;Curso&#39;],<br />&#160;&#160;&#160; colModel :[<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;id&#39;, index:&#39;t.id&#39;, width:65, hidden:true, editable:true},<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;nombre&#39;, index:&#39;t.nombre&#39;, search: false,width:100, editable:true },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;id_nivel&#39;, index:&#39;n.id&#39;, hidden:true, search: false,width:100, editable:true },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;nivel&#39;, index:&#39;n.nombre&#39;, width:100, editable:true, edittype: &#39;select&#39;,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; value:niveles,<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; attr: { title: &#39;Nivel&#39; },<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; dataEvents: [<br />&#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;&#160;&#160; &#160;var gr = jQuery("#list").getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;var ret = jQuery("#list").getRowData(gr);<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var nivel = e.currentTarget.value;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.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; url: &#39;/iae/index.php?r=curso/getCursos&#38;nivel=&#39;+nivel,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery("#list").setColProp(&#39;curso&#39;,{editoptions: {value: cursos}});<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;console.log(e);<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; }<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; ]<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160; },<br />&#160;&#160;&#160;&#160;&#160; {name:&#39;curso&#39;, index:&#39;c.nombre&#39;, edittype: &#39;select&#39;, width:100, editable:true,<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions : {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; beforeEditCell: function (e){<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; console.log(e);<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;&#160; dataEvents: [<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; { 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; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var gr = jQuery("#list").getGridParam(&#39;selrow&#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;var ret = jQuery("#list").getRowData(gr);<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;var nivel = e.currentTarget.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; console.log(e);<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; var a =jQuery("#list").getColProp(&#39;curso&#39;,&#39;editoptions&#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; console.log(a);<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; }<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; }<br />&#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; attr: {title:&#39;Some title&#39;}<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; loadComplete: function()&#160;&#160;&#160; {<br />//&#160;&#160;&#160; &#160;&#160;&#160; jQuery(&#39;#list&#39;).setColProp(&#39;nivel&#39;,{editoptions:{value:niveles}});<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; onSelectRow: function(id){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; if(id &#38;&#38; id!==lastsel){<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var ret = jQuery(&#8221;#list&#8221;).getRowData(id);<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;var cursos = $.ajax({<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; url: &#39;/iae/index.php?r=curso/getCursos&#38;nivel=&#39;+ret.id_nivel,<br />&#160;&#160;&#160; &#160;&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; async: false}).responseText;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;jQuery(&#8221;#list&#8221;).setColProp(&#39;curso&#39;,<br />&#160;&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; {editoptions: {value: cursos}});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).restoreRow(lastsel);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; jQuery(&#39;#list&#39;).editRow(id,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; lastsel=id;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;$(&#39;#cancel&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160;&#160; },<br />&#160;&#160;&#160; pager: jQuery(&#39;#pager&#39;),<br />&#160;&#160;&#160; autowidth:true,<br />&#160;&#160;&#160; rowList:[10,20,30,100],<br />&#160;&#160;&#160; sortname: &#39;t.nombre&#39;,<br />&#160;&#160;&#160; sortorder: &#8220;asc&#8221;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; gridview: true,<br />&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160; rownumWidth: 40,<br />&#160;&#160;&#160; editurl: &#39;/iae/index.php?r=trabajo/editTrabajo&#39;,<br />&#160;&#160;&#160; caption: &#39;Trabajos&#39;<br />&#160; });<br />})<br />&#160; jQuery.fn.log = function (msg) {<br />&#160;&#160;&#160;&#160;&#160; console.log(&#8221;%s: %o&#8221;, msg, this);<br />&#160;&#160;&#160;&#160;&#160; return this;<br />&#160; };<br />&#160; $(&#8221;#edit&#8221;).click(function(){ //only for testing, using the onclick for editing<br />&#160;&#160;&#160; &#160; var gr = jQuery(&#8221;#list&#8221;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ) {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery(&#8221;#list&#8221;).editGridRow(gr,{recreateForm: true,closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; //jQuery(&#8221;#list&#8221;).editRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,false);<br />&#160;&#160;&#160; &#160; }<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert(&#8221;No hay ningun registro seleccionado&#8221;);<br />&#160;&#160;&#160; &#160;&#160; });<br />&#160; $(&#8221;#cancel&#8221;).click(function(){<br />&#160;&#160;&#160; &#160; var gr = jQuery(&#8221;#list&#8221;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery(&#8221;#list&#8221;).restoreRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#cancel&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160; }<br />//&#160;&#160;&#160; &#160; jQuery(&#8221;#list&#8221;).editGridRow(gr,{closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert(&#8221;No hay ningun registro seleccionado&#8221;);<br />&#160;&#160;&#160; &#160;&#160; });<br />&#160; $(&#8221;#save&#8221;).click(function(){<br />&#160;&#160;&#160; &#160; var gr = jQuery(&#8221;#list&#8221;).getGridParam(&#39;selrow&#39;);<br />&#160;&#160;&#160; &#160; if( gr != null ){<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; jQuery(&#8221;#list&#8221;).saveRow(gr);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#save&#39;).attr(&#39;disabled&#39;,true);<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; $(&#39;#cancel&#39;).attr(&#39;disabled&#39;,true);<br />//&#160;&#160;&#160; &#160; jQuery(&#8221;#list&#8221;).editGridRow(gr,{closeAfterEdit : true,height:280,reloadAfterSubmit:false});<br />&#160;&#160;&#160; &#160; }<br />&#160;&#160;&#160; &#160; else<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160; alert(&#8221;No hay ningun registro seleccionado&#8221;);<br />&#160;&#160;&#160; &#160;&#160; });<br />&#60;/script&#62;</p></p>
]]></description>
        	        	<pubDate>Sun, 26 Jul 2009 13:08:35 +0300</pubDate>
        </item>
</channel>
</rss>