Hey guys, i having a problem with my page. I’m using 3 checkboxes and for each one of then there’s a respective combo that should be avaible only if the check box is checked.
I made a function “disableCombos” to disable all since the begining. This function use the matrix “matrixCheckBoxAndCombos” with the name of the checkbox and the combo.
But for some reason every time I unmark only one of the checkbox all the combos became enable.
Notice that no event was attributed to the checkboxes. Where am I wrong?
Sorry for the english. Not my native language.
[code]
var matrixCheckBoxAndCombos = new Array (['a',"comboA"],
['b',"comboB"],
['c', "comboC"]
);
function Initial() {
window.dhx_globalImgPath = "...";
main_layout = new dhtmlXLayoutObject(document.body, '2E');
CreateFirstColumnLayout();
}
function CreateFirstColumnLayout() {
dhtmlx.image_path='./codebase/imgs/';
main_layout = new dhtmlXLayoutObject(document.body, '2E');
var a = main_layout.cells('a');
a.setText("Filter Config");
var str = [
{ type:"fieldset" , name:"form_fieldset_1", label:"Fields", labelAlign:"left", position:"", list:[
//CHECK BOX COLUMN
{ type:"checkbox" , name:"a", label:"Plant", labelWidth:"90", labelHeight:"21", labelAlign:"left", position:"label-right" },
{ type:"checkbox" , name:"b", label:"WorkCenter", labelWidth:"90", labelHeight:"21", labelAlign:"left", position:"label-right" },
{ type:"checkbox" , name:"c", label:"PONum", labelWidth:"90", labelAlign:"left", position:"label-right" },
//COMBO COLUMN
{ type:"newcolumn" , position:"" },
{ type:"combo" , name:"comboA", label:" ", labelWidth:"40", labelAlign:"right", inputWidth:"90", inputHeight:"90", position:"label-right", options:[
{ text:"combo" },
{ text:"input" }
] },
{ type:"combo" , name:"comboB", label:" ", labelWidth:"40", labelAlign:"center", inputWidth:"90", position:"label-right", options:[
{ value:"combo", text:"combo" },
{ value:"input", text:"input" }
] },
{ type:"combo" , name:"comboC", label:" ", labelWidth:"40", labelAlign:"center", inputWidth:"90", position:"label-right" },
]}
];
formFilters = a.attachForm(str);
disableCombos(formFilters);
}
function disableCombos(formFilters){
for(i=0; i<9; i++)
formFilters.getCombo(matrixCheckBoxAndCombos[i][1]).disable(true);
}
//http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/04_dataprocessor/10_events.html
//http://www.dhtmlx.com/docs/products/dhtmlxGrid/samples/17_serialization/01_pro_serialize.html
</script>
</head>
<body onload="javascript:Initial();">
[/code]