Wijmo UI for the Web
cellStyleFormatter Option
wijmo.grid.wijgrid Namespace > options type : cellStyleFormatter Option

Creates a function that is called each time wijgrid changes a cell's appearance, for example, when the current cell position changes or a cell is selected. Use it to customize a cell's style depending on its state.

Default value: undefined

Type: Function

Syntax
$(function () {
    
    // Get value
    var returnsValue; // Type:  any
    returnsValue = $(".selector").wijgrid("option", "cellStyleFormatter");
    
    // Set value
    var newValue; // Type:  any
    $(".selector").wijgrid("option", "cellStyleFormatter", newValue);
        
});
var cellStyleFormatter : any;

Return Value

Returns true if wijgrid does not apply the default formatting.
Example
This example shows how to create a function that sets the current cell's font style to italic, and cells in any other render state to normal.
// Make the text of the current cell italic.
$("#element").wijgrid({
    highlightCurrentCell: true,
    cellStyleFormatter: function(args) {
        if ((args.row.type & wijmo.grid.rowType.data)) {
            if (args.state & wijmo.grid.renderState.current) {
                args.$cell.css("font-style", "italic");
            } else {
                args.$cell.css("font-style", "normal");
            }
        }
    }
});
Remarks
Parameters include:

When the args.state parameter is equal to wijmo.grid.renderState.rendering, this means that the cell is being created. This is when you can apply general formatting to it that is independent of any particular state, like current or selected.

See Also

Reference

options type
wijgrid jQuery Widget