I have this code i used to generate a Form and want to manipulate it, to enable or disable the objects inside a form:
i using: Combo_cuenta_activa.disable(disabled);
anyone have an idea how to access properly to the combo inside the form.
<script type="text/javascript">
dhtmlx.image_path = "codebase/imgs/";
dhtmlx.skin = "dhx_skyblue";
var main_layout = new dhtmlXLayoutObject("winVP", '1C');
var a = main_layout.cells('a');
a.hideHeader();
var str = [
{ type: "settings", position: "label-left", labelWidth: 260, inputWidth: 200 },
{ type:"fieldset" , name:"_nuevacuenta", label:"Nueva Cuenta" , inputWidth: "auto", list:[
{type: "block", width: 800, list:[
{type:"newcolumn"},
{ type:"combo" , name:"cuenta_activa", label:"Cuenta Activa",
connector: "opciones/cuentas/agregar/combo_options.xml"
},
{ type:"input" , name:"_cuentacredito", label:"Numero de Cuenta" }
]},
{type: "block", width: 800, list:[
{ type:"input" , name:"_cuentamadre", label:"Cuenta Madre" },
{ type:"input" , name:"_nombre_comercial", label:"Nombre Comercial" },
{ type:"input" , name:"_nombre_legal", label:"Nombre Legal" },
{ type:"input" , name:"_representante_legal", label:"Representante Legal" }
]},
{type: "block", width: 800, list:[
{ type:"calendar" , name:"_fecha_fundacion", label:"Fecha Fundacion", dateFormat:"%d-%m-%Y", readonly:true, enableTime:true, serverDateFormat:"%d-%m-%Y ", options:{
} },
{ type:"input" , name:"_rtn", label:"RTN" },
{type:"newcolumn"},
{ type:"combo" , name:"_sector", label:"Sector Comercial" },
{ type:"combo" , name:"_subsector", label:"Subsector" }
]},
{ type:"input" , name:"_sitioweb", label:"Sitio Web" },
{ type:"input" , name:"_estimado_compra_anual", label:"Estimado de Compra Anual" },
{ type:"combo" , name:"_estado_posible_cliente", label:"Estado de Posible Cliente" },
{ type:"input" , name:"_limite_credito_solicitado", label:"Limite de Credito Solicitado" },
{ type:"combo" , name:"_sucursal", label:"Sucursal" },
{ type:"button" , name:"_btn_agregar_cuenta", value:"Agregar Cuenta" }
] }
];
var form_1 = a.attachForm(str);
//form_1.setImagePath("codebase/imgs/");
//form_1.setSkin('dhx_web');
//form_1.getItem("cuenta_activa").readonly(true,false);
//form_1.getItem("cuenta_activa").disable(true);
Combo_cuenta_activa = form_1.getCombo('cuenta_activa');
Combo_cuenta_activa.disable(disabled);
//form_1.load()
var status_49 = main_layout.attachStatusBar();
status_49.setText('');
</script>