Initializes a new instance of the CommandEventArgs class.
Namespace: MindFusion.DataViews
File: EventArgs.js
JavaScript Copy Code |
---|
function CommandEventArgs (commandName, control, row, rowData) |
String. The string identifier of the executed command.
HTMLElement. The controller that triggered the command.
Number. The index of the row, for which the command is executed.
Object. The row data.
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; } |