Search
CellCustomDrawEventArgs Constructor
See Also
 






Initializes a new instance of the CellCustomDrawEventArgs class.

Namespace: MindFusion.DataViews
File: EventArgs.js

 Syntax

JavaScript  Copy Code

function CellCustomDrawEventArgs (row, column, defaultContent)

 Parameters

row

Number. The row index of the cell.

column

Number. The column index of the cell.

defaultContent

Node. The default content displayed in the cell.

 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