[CLOSED] Adding listerner to imagecommandcolumn from codebehind

  1. #1

    [CLOSED] Adding listerner to imagecommandcolumn from codebehind

    I would like to create this in code:


            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]
  2. #2
    Hi,

    You referred Ext.NET v2 example, but, I guess, actually use Ext.NET v1.

    ImageCommandColumn has no any listeners in Ext.NET v1.

    Here is the same example for Ext.NET v1.
    https://examples1.ext.net/#/GridPane...Image_Command/

    Just "examples.ext.net" replaced with "examples1.ext.net" within the link.
  3. #3
    mmmm sorry..

    I''m working on 2 projects on both frameworks and sometimes get mixed up :)

    Mark as closed.

    Regards,

    Martin

Similar Threads

  1. Replies: 1
    Last Post: Jan 25, 2012, 8:17 AM
  2. Adding Tab using codebehind
    By gevik in forum 1.x Help
    Replies: 9
    Last Post: Oct 02, 2011, 7:43 PM
  3. [CLOSED] adding handler listener in codebehind
    By ashton.lamont in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: May 05, 2010, 4:50 PM
  4. FormPanel CodeBehind item adding BUG
    By davutengin in forum 1.x Help
    Replies: 3
    Last Post: Jun 18, 2009, 1:26 PM
  5. FormPanel CodeBehind item adding
    By davutengin in forum 1.x Help
    Replies: 0
    Last Post: Jun 15, 2009, 5:53 AM

Posting Permissions