Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/10/2010, 16:19
hicolu
 
Fecha de Ingreso: agosto-2009
Ubicación: Lima
Mensajes: 226
Antigüedad: 14 años, 8 meses
Puntos: 3
Respuesta: desabilitar boton en EXTjs

amigos SOSSSSSSSSS.yo no hice el formulario,se poco de EXTjs o mejor dicho casi nada

alguien que pueda ayudarme a implementar esto: cuando esten marcados los 2 checks debe de habilitarse el boton

le adjunto mi codigo

gracias un millon


....>


var grid = new Ext.grid.GridPanel({
title:'Modificaciones de Presupuesto',
store: store,
columns: [
{header: "Clasif. Gastos.", width: 240,dataIndex: 'fuente'},
{header: "Tipo. Modif.", width: 70,dataIndex: 'tipoModificacion'},
{header: 'Cod. Especifica', width: 90, dataIndex: 'cod_especifica'},
{header: "Monto", width: 75,hidden:true,dataIndex: 'montoInicial',xtype: 'numbercolumn'},
{header: "Modificacion", width: 75,dataIndex: 'modificacion' ,xtype: 'numbercolumn'},
{header: "Saldo", width: 75 ,hidden:true,dataIndex: 'saldo',xtype: 'numbercolumn'}

],
stripeRows: true,
autoHeight:true,
width:600,
renderTo:'presupuestal'
});

var fisicoCheck = new Ext.form.Checkbox({
fieldLabel: 'Aprobar Modificación Meta Física',
name:'fisicoCheck',
id:'fisicoCheck'
});

var pptoCheck = new Ext.form.Checkbox({
fieldLabel: 'Aprobar Modificación Presupuestal',
name:'pptoCheck',
id:'pptoCheck'

});


var comentario = new Ext.form.TextArea({
fieldLabel:'Comentario',
name:'comentario',
id:'comentario',
width:500,
height:50
});

//lhc 22/10/2010
habilitar: function() {

if (fisicoCheck.getValue()==true && pptoCheck.getValue()==true) {
Ext.getCmp("botonmetas").disable();
//botonmetas.setDisabled(false);
// alert("ok");
} else {
Ext.getCmp("botonmetas").enable();
//botonmetas.setDisabled(true);
}
}

//-- FORMULARIO DE APROBACION --//
function aprobar(){
var fisico = null;
var ppto = null;
if (fisicoCheck.getValue()){
fisico=1;
alert("1");
}else{
fisico=2;
alert("2");

}
if (pptoCheck.getValue()){

ppto=1;
}else{
ppto=2;
}






Ext.Ajax.request({
url: '<?=base_url()."index.php/modulo/mod43_accion";?>',
method: 'POST',
params: {
idMeta : <?=$idMeta?>,
comentario : comentario.getValue(),
fisico : fisico,
ppto: ppto
},
success: function (action,options){
var data=Ext.util.JSON.decode(action.responseText);
Ext.Msg.alert('Mensaje de Exito...', data.message, function(btn, text){
if (btn == 'ok' || btn=='yes'){
window.close();
}
});
}

});
}

var form = new Ext.FormPanel({
renderTo: 'form',
defaults:{xtype:'textfield'},
bodyStyle:'background: #E5E5E8;',
border:false,
width:700,
labelWidth:200,
labelAlign:'right',
items:[
fisicoCheck,
pptoCheck,
comentario
],
buttonAlign: 'center', //<--botones alineados a la derecha
buttons:[
{
text:'Aprobar metas',
id:'botonmetas',
disabled:true,

listeners : {
click: function(){
aprobar();
habilitar();



}
}
}
]
});


}
}

Ext.onReady(com.mod43.Form1.init,com.mod43.Form1);

</script>


...>