Dannesart
28 Nov 2011, 6:27 AM
Hi I got a checkbox and a triggerfield. So when I check the checkbox the triggerfield should be enable, and default should be disable.
my triggerfield:
{
xtype: 'common.user.triggerfield',
fieldLabel: 'Säljare',
disabled: true,
emptyText: 'Välj säljare',
labelWidth: 120,
itemId: 'selectSalesPerson'
}
my checkbox:
{
xtype: 'checkboxfield',
fieldLabel: 'Skapa säljsamtal',
labelWidth: 120,
itemId: 'createSale'
},
And the code events:
initComponent: function () {
this.callParent(arguments);
this.defineReferences();
this.createSale.on('change', this.onCreateSalesSelected, this);
this.selectSalesPerson.on('validitychange', this.onSelectSalesPerson, this);
},
defineReferences: function() {
this.createSale = this.down('#createSale');
his.selectSalesPerson = this.down('#selectSalesPerson');
},
onCreateSalesSelected: function(model, selected, options) {
this.onSelectSalesPerson().setDisabled(false);
},
onSelectSalesPerson: function(model){
model.get('selectSalesPerson');
},
anyone knows what I have to do?
my triggerfield:
{
xtype: 'common.user.triggerfield',
fieldLabel: 'Säljare',
disabled: true,
emptyText: 'Välj säljare',
labelWidth: 120,
itemId: 'selectSalesPerson'
}
my checkbox:
{
xtype: 'checkboxfield',
fieldLabel: 'Skapa säljsamtal',
labelWidth: 120,
itemId: 'createSale'
},
And the code events:
initComponent: function () {
this.callParent(arguments);
this.defineReferences();
this.createSale.on('change', this.onCreateSalesSelected, this);
this.selectSalesPerson.on('validitychange', this.onSelectSalesPerson, this);
},
defineReferences: function() {
this.createSale = this.down('#createSale');
his.selectSalesPerson = this.down('#selectSalesPerson');
},
onCreateSalesSelected: function(model, selected, options) {
this.onSelectSalesPerson().setDisabled(false);
},
onSelectSalesPerson: function(model){
model.get('selectSalesPerson');
},
anyone knows what I have to do?