나는 Sencha에서 무언가를 바꿀 필요가있다. 나는 두 번째 콤보 박스를 추가해야하는데, 처음에는 비활성화되어 있어야하는데, 괜찮다.하지만 그 다음에는 첫 번째 콤보 박스가 두 번째 콤보 박스를 사용할 수 있도록해야한다. 모두)가 선택되면 매우 간단 해 보입니다. 여기 SENCHA/ext js에서 다른 콤보 박스의 콤보 박스를 활성화하는 방법은 무엇입니까?
코드입니다 :var formPanel = new Ext.form.FormPanel({
id: 'formanchor-form',
title: 'Nuevo Gasto',
bodyStyle: 'padding:5px 5px 0',
width: 600,
defaults: {
width: 230
},
defaultType: 'textfield',
renderTo: 'formulario',
frame: true,
items: [{
xtype: 'combo',
typeAhead: true,
name: 'cboGasto',
id: 'cboGasto',
fieldLabel: 'Gastos',
store: storeCbo,
displayField: 'gasto',
valueField: 'codigo',
allowBlank: false,
width: 250,
mode: 'local',
triggerAction: 'all',
emptyText: 'SELECCIONE',
blankText: 'Debe seleccionar un gasto',
forceSelection: true
}, {
xtype: 'numberfield',
fieldLabel: 'Monto',
name: 'txtMonto',
id: 'txtMonto',
maxLength: 7,
allowBlank: false,
minValue: 100,
minText: 'El monto mínimo es 100',
maxValue: 9999999,
maxLengthText: 'El monto máximo es 9.999.999',
blankText: 'El monto es requerido',
width: 100
}, {
xtype: 'combo',
typeAhead: true,
name: 'CboDeudasReceptor',
id: 'CboDeudasReceptor',
fieldLabel: 'Receptor',
store: storeCboR,
displayField: 'receptor',
valueField: 'codigo',
allowBlank: false,
width: 250,
mode: 'local',
triggerAction: 'all',
emptyText: 'SELECCIONE',
blankText: 'Debe seleccionar un Receptor',
forceSelection: true,
disabled: true
}],
buttons: [{
text: 'Agregar',
handler: function() {
var mon = Ext.getCmp('txtMonto').getValue();
var gas = Ext.getCmp('cboGasto').getValue();
if (mon.length == 0) {
Ext.MessageBox.alert('Monto del Gasto', 'Debe Ingresar un monto para el gasto.');
Ext.getCmp('txtMonto').focus();
return false;
}
if (gas.length == 0) {
Ext.MessageBox.alert('Gasto', 'Debe Seleccionar un gasto.');
Ext.getCmp('cboGasto').focus();
return false;
}
location.href = 'ingresa_gastos_lib.asp?cboGasto=' + gas + '&txtMontoPesos=' + mon + '&' + params();
}
}, {
text: 'Volver',
handler: function() {
location.href = 'datos_deuda.asp?' + params();
}
}]
});
UPDATE :
내가 처음 콤보 수신기를 넣으면, 내가 원하는 것처럼 다음 부분 작동하지만, 2 콤보 그냥 드롭 다운을 작동 여전히 장애인처럼 보이고 편집 할 수 없습니다. 이제 문제는 두 번째 콤보 박스를 어떻게 완전하게 작동 시키는가하는 것입니다.
당신이 [바이올린]를 제공 할 수 있습니다 (https://fiddle.sencha.com/) –