Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jorge Arzuaga on Apr 08, 2009 08:20
open dhtmlx forum
dhtmlXCombo for 3 or parents values.

Hi, i have 3 combox,but i need that the third combox depend of first an second, in the where i need :

combo (producto) 1: ; Selected 1
combo (marca) 2: WHERE producto_id= 1; Selected 1
combo (others) 2: WHERE producto_id= 1 AND marca_id = 1;


But the combox only send one parent, the last combo how do it ?

<script type="text/javascript">    

var ComboObj_producto_ids=new dhtmlXCombo("ComboObj_producto_ids","producto_ids","296", true, 1);
ComboObj_producto_ids.enableFilteringMode(true);    

var ComboObj_marca_id=new dhtmlXCombo("ComboObj_marca_id","marca_id","296", true, 1);

ComboObj_marca_id.enableFilteringMode(true);
ComboObj_marca_id.attachChildCombo(ComboObj_producto_ids,"../../js/php/complete.php?id=1");
ComboObj_marca_id.loadXML("../../js/php/complete.php?id=2");

var ComboObj_tipo_producto=new dhtmlXCombo("ComboObj_tipo_producto","tipo_producto","296", true, 1);
ComboObj_tipo_producto.attachChildCombo(ComboObj_marca_id,"../../js/php/complete.php?id=1");
ComboObj_tipo_producto.loadXML("../../js/php/complete.php?id=1");


</script>
Answer posted by Alex (support) on Apr 08, 2009 08:57

Hello, 

In this case ground extension can't be used. 

You can set onChange event handler for teh necessary combos. For example :

producto.attachEvent("onChange",function(){

marca.clearAll();

marca.loadXML(path1+"?parent="+producto.getActualValue(),refreshOthers);

})

marca.attachEvent("onChange",refreshOthers);

function refreshOthers(){

others.clearAll();

others.loadXML(path2+"?parent1="+producto.getActualValue()+"&parent2="+marca.getActualValue());

}

Answer posted by Jorge Arzuaga on Apr 08, 2009 10:00
Hi.. thanks it`s works... very thanks...!