Raised when a command is executed on a row.
Namespace: MindFusion.DataViews
File: Grid.js
JavaScript Copy Code |
---|
EventDispatcher rowCommand |
The event handler method receives the following arguments:
sender
A Grid instance, which is the source of the event. This object will be passed to the handler function as the first argument.
args
A RowModifyingEventArgs instance, which contains event data. This object will be passed to the handler function as the second argument.
The following code handles the rowCommand event of a grid. The event data is provided by the CommandEventArgs class, which derives from RowModifyingEventARgs:
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; } |