parse

loads data into spreadsheet from a local data source

void parse(any data);

Parameters

dataanythe data to load

Example

var data = [
    { cell: "a1", value: "Country" },
    { cell: "b1", value: "Product" },
    { cell: "c1", value: "Price" },
    { cell: "d1", value: "Amount" },
    { cell: "e1", value: "Total Price" },
 
    { cell: "a2", value: "Ecuador" },
    { cell: "b2", value: "Banana" },
    { cell: "c2", value: 6.68, css: "someclass" },
    { cell: "d2", value: 430 },
    { cell: "e2", value: 2872.4 }
 
    // more data
];
 
var styledData = {
    data: data,
    styles: {
        someclass: {
            background: "#F2F2F2",
            color: "#F57C00"
        }
    }
};
 
var spreadsheet = new dhx.Spreadsheet("spreadsheet_container", {});
spreadsheet.parse(styledData);

Related samples

See also
Back to top