Wijmo UI for the Web
cellStyleFormatter Option

This function is called each time wijgrid needs to change cell appearence, for example, when the current cell position is changed or cell is selected. Can be used for customization of cell style depending on its state.

Syntax
Javascript (Usage) 
$(function () {
    
    // Get value
    var returnsValue; // Type:  any
    returnsValue = $(".selector").wijgrid("option", "cellStyleFormatter");
    
    // Set value
    var newValue; // Type:  any
    $(".selector").wijgrid("option", "cellStyleFormatter", newValue);
        
});
Javascript (Specification) 
var cellStyleFormatter : any;
Example
// 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
The args.state parameters equal to wijmo.grid.renderState.rendering means that the cell is being created, at this moment you can apply general formatting to it indepentant of any particular state, like "current" or "selected".
Browser Compatibility
7
5
5

See Also

Reference

options type
wijgrid jQuery Widget

 

 


© 2013 All Rights Reserved.

Send comments on this topic.