Search
Grid.rowCommand Event
See Also
 






Raised when a command is executed on a row.

Namespace: MindFusion.DataViews
File: Grid.js

 Syntax

JavaScript  Copy Code

EventDispatcher rowCommand

 Event Data

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.

 Example

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;         
}

 See Also