PDA

View Full Version : How to disable icon/button in a grid?



lehmag
27 Mar 2014, 4:58 AM
Hi, I've been working on some ExtJS code for most of this week just trying to get a clickable icon to display in a grid. We can get the icon to display and click on it. But, ultimately we want to be able to disable (gray out or hide) and then enable it when the radio button (BankInstrRadio) on the same row is selected. The only thing I've been able to do is hide the button. But then I can't figure out how to unhide it. Does anyone know of a way to do this? I wouldn't think it would be that difficult, but then again I'm not a ExtJS or javascript expert. Any help would be appreciated! Here is a snippet of the code that displays the bankEdit icon:

items: [
{
xtype: 'container',
html: 'Bank Instructions',
padding: '0 0 0 5',
cls: 'sell-container-header'
},
{
xtype: 'grid',
title: false,
header: false,
store: 'bankInstructionsStore',

columns: [
{
flex: 0.01,
xtype: 'templatecolumn',
tpl: new Ext.XTemplate('<input type="radio" name="BankInstrRadio" {bankRadioChecked} />')
},
{
text: 'Bank Name',
dataIndex: 'bankName',
flex: 3,
menuDisabled: true
},
{
text: 'Account',
dataIndex: 'bankAccountNumberEdited',
flex: 2,
menuDisabled: true
},
{
flex: 0.75,
xtype: 'templatecolumn',
tpl: new Ext.XTemplate('<i id="bankEdit" class="alloy-icon-edit" data-qtip="Edit"/>'
)
}
],

scottmartin
28 Mar 2014, 6:57 AM
You should consider using an actioncolumn so you can use getClass to style.