Wijmo UI for the Web
cellFormatter Field

Function used for changing content, style and attributes of the column cells.

Syntax
Javascript (Usage) 
var instance; // Type: wijmo.grid.IC1BaseFieldOptions;
var value; // Type: any
value = instance.cellFormatter;
Javascript (Specification) 
var cellFormatter : any;
Example
// Add an image which URL is obtained from the "Url" data field to the column cells.
$("#demo").wijgrid({
    data: [
        { ID: 0, Url: "/images/0.jpg" },
        { ID: 1, Url: "/images/1.jpg" }
    ],
    columns: [
        {},
        {
            cellFormatter: function (args) {
                if (args.row.type & wijmo.grid.rowType.data) {
                    args.$container
                        .empty()
                        .append($("<img />")
                            .attr("src", args.row.data.Url));
                    return true;
                }
            }
        }
    ]
});
Browser Compatibility
7
5
5

See Also

Reference

IC1BaseFieldOptions Interface

 

 


© 2013 All Rights Reserved.

Send comments on this topic.