Search
Command.createControl Method
See Also
 






Override this method in a derived class to customize the command controller.

Namespace: MindFusion.DataViews
File: Command.js

 Syntax

JavaScript  Copy Code

function createControl ()

 Return Value

HTMLElement. The controller.

 Example

The following code extens the Command class to implement a delete command that shows a confirmation dialog:

JavaScript  Copy Code

// define a delete command, that shows a confirmation dialog before deleting the record
class ConfirmDeleteCommand extends dv.Command
{
    static get name() { return "Delete"; }

    static createControl(sender, args)
    {
        var control = document.createElement("button");
        control.innerHTML = "Delete";
        if (args.row === editRow)
            control.style.display = "none";
        return control;
    }
}

 See Also