Sep 12, 2012, 3:29 PM
[CLOSED] Change a ImageCommands Icon with JS
Hi
I have to modify a Image Commands Icon based on a Value I the Grid.
Here's a part of the Grid Markup :
I tried this but it doesn work (no icon is shown)
Peter
I have to modify a Image Commands Icon based on a Value I the Grid.
Here's a part of the Grid Markup :
<ext:Column ColumnID="colHasOrder" DataIndex="HasOrder" Header="<%$ Resources:CUSTRocheImport, HasOrder %>" Width="150" Editable="False" Hidden="true" Groupable="true" Sortable="true" MenuDisabled="False" />
<ext:ImageCommandColumn Width="25">
<Commands>
<ext:ImageCommand Icon="CartMagnify " CommandName="cmdShowOrder">
<ToolTip Text="<%$ Resources:CUSTRocheImport, ShowOrder %>" />
</ext:ImageCommand>
</Commands>
<PrepareCommand Fn="showHasOrderLink" />
</ext:ImageCommandColumn>
In case of 'HasOrder' the Image Command Icon should be 'CardMagnify' else 'Error'. The HasOrder Field is boolean.I tried this but it doesn work (no icon is shown)
var showHasOrderLink = function (grid, command, record, row) {
{
alert(record.get('HasOrder'));
if (record.get('HasOrder') == true) {
command.iconCls = "CartMagnify";
} else {
command.iconCls = "Error";
}
}
};
Any Idea ?Peter
Last edited by Daniil; Sep 18, 2012 at 12:24 PM.
Reason: [CLOSED]