Search
CellCustomDrawEventArgs.defaultContent Property
See Also
 






Gets the default content, displayed in the cell.

Namespace: MindFusion.DataViews
File: EventArgs.js

 Syntax

JavaScript  Copy Code

get defaultContent() {}

 Property Value

Node. The default content.

 Example

The following code handles the customDrawHeader event of Grid where it uses the defaultContent property of the CellCustomDrawEventArgs, which provides the data for the event:

JavaScript  Copy Code

grid.customDrawHeader.addEventListener(function (sender, args)
{
    var div = document.createElement("div");
    div.style.backgroundColor = "darkcyan";
    div.style.color = "#fff";
    div.style.textAlign = "center";
    div.style.fontSize = "larger";
    div.style.padding = "10px 5px";
    div.style.borderRadius = "5px";

    if (args.column === 4 || args.column === 5)
    {
        var button = document.createElement("button");
        button.innerHTML = "Σ";
        button.style.float = "left";
        button.addEventListener("click", (e) => { e.stopPropagation(); showSum(args.column) });
        div.appendChild(button);
    }

    div.appendChild(args.defaultContent);
    args.content = div;
});

 See Also