PDA

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



matrixwebtech
Apr 23, 2015, 6:07 PM
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 .

Dimitris
Apr 23, 2015, 7:43 PM
You should also add the following line in your code:



de.Command.Confirmation.ConfirmRequest = true;



Hope it helps.

matrixwebtech
Apr 24, 2015, 4:35 AM
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?

Dimitris
Apr 24, 2015, 8:37 AM
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.

matrixwebtech
Apr 24, 2015, 8:54 AM
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 .

Dimitris
Apr 24, 2015, 11:19 AM
Please, open another thread about your last question.