Search
CellCustomDrawEventArgs.content Property
See Also
 






Gets or sets the new content to be displayed in the cell.

Namespace: MindFusion.DataViews
File: EventArgs.js

 Syntax

JavaScript  Copy Code

get content() {}

 Property Value

Node. The new content.

 Example

The following code handles the customDrawCell event of a Grid, which uses the CellCustomDrawEventArgs class and the content property:

JavaScript  Copy Code

grid.customDrawCell.addEventListener(function (sender, args)
{
    if (args.row === grid.model.rowCount) return;

    if (args.column === 1)
    {
        var div = document.createElement("div");
        div.style.backgroundColor = args.row % 2 === 0 ? "#fcf3c1" : "#f2fafe";
        div.style.textAlign = "center";
        div.style.fontSize = "larger";
        div.style.borderRadius = "5px";
        div.appendChild(args.defaultContent);
        args.content = div;
    }
    else if (args.column === 2)
    {
       //drawing code here
    }
 
})

 See Also