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

Default value: false

A value indicating whether DOM cell attributes can be passed within a data value.

Syntax
$(function () {
    
    // Get value
    var returnsValue; // Type:  boolean
    returnsValue = $(".selector").wijgrid("option", "readAttributesFromData");
    
    // Set value
    var newValue; // Type:  boolean
    $(".selector").wijgrid("option", "readAttributesFromData", newValue);
        
});
var readAttributesFromData : boolean;
Example
// Render the style attribute passed within the data.
$("#element").wijgrid({
    readAttributesFromData: false });
    data: [
        [ [1, { "style": "color: red" } ], a ]
    ]
});
Remarks
This option allows binding collection of values to data and automatically converting them as attributes of corresponded DOM table cells during rendering. Values should be passed as an array of two items, where first item is a value of the data field, the second item is a list of values: $("#element").wijgrid({ data: [ [ [1, { "style": "color: red", "class": "myclass" } ], a ] ] }); or $("#element").wijgrid({ data: [ { col0: [1, { "style": "color: red", "class": "myclass" }], col1: "a" } ] }); Note: during conversion wijgrid extracts the first item value and makes it data field value, the second item (list of values) is removed: [ { col0: 1, col1: "a" } ] If DOM table is used as a datasource then attributes belonging to the cells in tBody section of the original table will be read and applied to the new cells. rowSpan and colSpan attributes are not allowed.
See Also

Reference

options type
wijgrid jQuery Widget