Search
CellCustomDrawEventArgs Class
Remarks See Also
 






Provides data for custom draw events.

Namespace: MindFusion.DataViews
File: EventArgs.js

 Syntax

JavaScript  Copy Code

// class
CellCustomDrawEventArgs.prototype = {}

 Remarks

The CellCustomDrawEventArgs class provides data for customDrawCell and customDrawHeader events of Grid.

 Example

The following code handles the customDrawCell event of a Grid, which uses the CellCustomDrawEventArgs class to provide event data.

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

 Inheritance Hierarchy

MindFusion.DataViews.EventArgs
    MindFusion.DataViews.CellEventArgs
        MindFusion.DataViews.CellCustomDrawEventArgs

 See Also