Search
CommandEventArgs Constructor
See Also
 






Initializes a new instance of the CommandEventArgs class.

Namespace: MindFusion.DataViews
File: EventArgs.js

 Syntax

JavaScript  Copy Code

function CommandEventArgs (commandName, control, row, rowData)

 Parameters

commandName

String. The string identifier of the executed command.

control

HTMLElement. The controller that triggered the command.

row

Number. The index of the row, for which the command is executed.

rowData

Object. The row data.

 Example

The following code handles the rowCommand event of a grid. The event data is provided by the CommandEventArgs class:

JavaScript  Copy Code
grid.rowCommand.addEventListener(function (sender, args)
{
    if (args.commandName == "Delete")
    {       
         ui.Dialogs.showConfirmDialog("Confirm", "Delete record?", function (result)
         {
             if (result == ui.ModalResult.OK)
             {
                 grid.removeRows(this.row);
             }
         }.bind(args), sender.element, grid.theme);
         args.cancel = true;         
}

 See Also