[CLOSED] CommandColumn : Command.Confirmation.Message before DirectEvents fire

  1. #1

    [CLOSED] CommandColumn : Command.Confirmation.Message before DirectEvents fire

    Hi I have a CommandColumn like bellow

    Html.X().CommandColumn()
                        .Width(80)
                        .Commands(
                            Html.X().GridCommand()
                                .Icon(Icon.ArrowDown)
                                     .Menu(menu =>
                                    {
                                        menu.EnableScrolling = false;
                                        menu.Items.Add(Html.X().MenuCommand()
                                            .Text("Completed")
                                            .Icon(Icon.Accept)
                                            .CommandName("Completed")
                                        );
                                        menu.Items.Add(Html.X().MenuCommand()
                                           .Text("Process")
                                           .Icon(Icon.PlayGreen)
                                           .CommandName("Process")
                                       );
                                        menu.Items.Add(Html.X().MenuCommand()
                                           .Text("Pending")
                                           .Icon(Icon.StopRed)
                                           .CommandName("Pending")
                                       );
                                        
                                    })
                                    .ToolTip(tt => tt.Text = "Menu")	
                                
                        )
                        //.Listeners(ls => ls.Command.Handler = "Ext.Msg.alert(command, record.data.MenuID);")
                             .DirectEvents(de =>
                                {
                                    de.Command.Confirmation.Message = "";
                                    /*de.Command.Before = @"return Ext.Msg.show({
                                                            title:'Save Changes?',
                                                            msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
                                                            buttons: Ext.Msg.YESNO,
                                                            icon: Ext.Msg.QUESTION
                                                    }); ";*/
                                    de.Command.Action = "statuschange";
                                    de.Command.ExtraParams.Add(new
                                    {
                                        MenuID = new JRawValue("record.data.MenuID"),
                                        Status = new JRawValue("command")
                                    });
                                    de.Command.EventMask.ShowMask = true;
                                    de.Command.Success = "#{GridPanel1}.getStore().reload()";
                                })
    I try both Confirmation.Message and Before handler but in case Confirmation.Message message not show and DirectEvents fires and in case Before handler message show but DirectEvents fires at the same time.
    I want to shoa a confirmation message box before DirectEvents .
    Last edited by Dimitris; Apr 24, 2015 at 11:19 AM. Reason: [CLOSED]
  2. #2
    You should also add the following line in your code:

    de.Command.Confirmation.ConfirmRequest = true;

    Hope it helps.
  3. #3
    Hi, Dimitris
    I use your piece of code and now its works fine .I want to set a message like bellow
    de.Command.Confirmation.Message = "Are you sure to change the status of '+record.data.company+'";
    But the company name not show in message box.How I prnt the company name in confirmation message box?
  4. #4
    You can use the following line:

    de.Command.Confirmation.BeforeConfirm = "config.confirmation.message = 'Are you sure to change the status of  ' + record.data.company + '?';";

    Hope it helps.
  5. #5
    Hi
    thankx for help this is works.can you please tell me one more thing when and how do I use de.Command.Confirmation.CustomConfig .
  6. #6
    Please, open another thread about your last question.

Similar Threads

  1. [CLOSED] Conditional confirmation on GridPanel commandColumn
    By rmelancon in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: May 08, 2014, 12:27 PM
  2. CommandColumn and DirectEvents
    By lethanhson in forum 2.x Help
    Replies: 1
    Last Post: May 10, 2013, 11:07 PM
  3. Replies: 9
    Last Post: Apr 25, 2012, 8:03 AM
  4. Replies: 3
    Last Post: Aug 18, 2010, 9:34 PM
  5. Replies: 4
    Last Post: Jul 17, 2010, 8:21 AM

Posting Permissions