PDA

View Full Version : disable button if selected row not got any value on specific column



Dannesart
22 Nov 2011, 11:24 PM
Hi is it possible to disable a button if a spefic row aint got no value?
29500
If the column "Bekräfta" got a value, then the button "Bekräfta" in the dropdown should be "Not disabled"

Code for disable all the buttons if no rows are selected:

setDisabledOnMessagingButtons: function(disabled) {
this.sendSmsButton.setDisabled(disabled);
this.sendEmailButton.setDisabled(disabled);
this.sendPortalInfoButton.setDisabled(disabled);
this.confirmButton.setDisabled(disabled)
},

onGridSelectionChange: function(model, selected, options) {

this.setDisabledOnMessagingButtons(model.getCount() < 1)

},

mitchellsimoens
23 Nov 2011, 6:57 AM
How are you inserting the button? Is it an Action column or is it put in using a renderer or....?

Dannesart
23 Nov 2011, 7:03 AM
It's in a menu,
Extend: 'Ext.menu.Menu',


Ext.define('Intelliplan.Modules.Staffing.Consultant.sendPicker.MenuUi', {
extend: 'Intelliplan.Base.Menu.Standard',
initComponent: function() {
Ext.apply(this, function() {

});
this.callParent(arguments);
},
defineItems: function(){
var menu = [

{
xtype: 'button',
text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendSmsButton.Text'),
tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendSmsButton.Tooltip'),
itemId: 'sendSmsButton',
disabled: true,
cls: 'split-button communicationDropdownMenu confirmShiftsButton',
iconCls: 'silk-phone'

},
{
xtype: 'button',
text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendEmailButton.Text'),
tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendEmailButton.Tooltip'),
itemId: 'sendEmailButton',
disabled: true,
cls: 'split-button communicationDropdownMenu confirmShiftsButton',
iconCls: 'silk-email'
},
{
xtype: 'button',
text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Text'),
tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Tooltip'),
itemId: 'sendPortalInfoButton',
disabled: true,
cls: 'split-button communicationDropdownMenu confirmShiftsButton',
iconCls: 'icon-portal-email'
},
{
xtype: 'button',
text: 'Bekräfta',
// text: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Text'),
tooltip: IPtranslate('Intelliplan.Modules.Staffing.Consultant.GridUi.SendPortalInfoButton.Tooltip'),
itemId: 'confirmButton',
disabled: true,
cls: 'split-button communicationDropdownMenu confirmShiftsButton',
iconCls: 'silk-accept'
}
]
return menu;
}
});