Sep 04, 2012, 11:40 AM
[CLOSED] Adding listerner to imagecommandcolumn from codebehind
I would like to create this in code:
Any tips ?
I'm trying to add functionality as your example here: https://examples2.ext.net/#/GridPane...Image_Command/
Martin
ImageCommandColumn cc = new ImageCommandColumn { Width = 66 };
ImageCommand gc = new ImageCommand { Icon = Icon.ApplicationViewDetail, CommandName = "Details"};
gc.ToolTip.Text = "Details";
cc.Commands.Add(gc);
ImageCommand gcc = new ImageCommand { Icon = Icon.Calculator, CommandName = "Berekening" };
gcc.ToolTip.Text = "Berekening";
cc.Commands.Add(gc);
cc.PrepareCommand.Fn = "prepareCommand";
//Here I like to add a listener to the cc, but according to my intellisense.. I can't
gpDetailsBrandstof.ColumnModel.Columns.Add(cc);
Any tips ?
I'm trying to add functionality as your example here: https://examples2.ext.net/#/GridPane...Image_Command/
<ext:ImageCommandColumn runat="server" Width="110">
<Commands>
<ext:ImageCommand CommandName="Delete" Icon="Delete" Text="Delete">
<ToolTip Text="Delete" />
</ext:ImageCommand>
<ext:ImageCommand CommandName="Edit" Icon="TableEdit" Text="Edit">
<ToolTip Text="Edit" />
</ext:ImageCommand>
</Commands>
<GroupCommands>
<ext:GroupImageCommand CommandName="Delete" Icon="Delete" Text="Delete">
<ToolTip Text="Delete" />
</ext:GroupImageCommand>
<ext:GroupImageCommand CommandName="Edit" Icon="TableEdit" Text="Edit">
<ToolTip Text="Edit" />
</ext:GroupImageCommand>
<ext:GroupImageCommand CommandName="Chart" Icon="ChartBar" RightAlign="true">
<ToolTip Text="Chart" />
</ext:GroupImageCommand>
</GroupCommands>
<PrepareCommand Fn="prepareCommand" />
<PrepareGroupCommand Fn="prepareGroupCommand" />
<Listeners>
<Command Handler="Ext.Msg.alert(command, record.data.Common);" />
<GroupCommand Handler="Ext.Msg.alert(command, 'Group name: '+ group.name +'<br/>Count - ' + group.children.length);" />
</Listeners>
</ext:ImageCommandColumn>
Martin
Last edited by Daniil; Sep 04, 2012 at 1:12 PM.
Reason: [CLOSED]