JSFiddle - React, Tailwind, and code Playground

by psoares

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dijit/themes/claro/claro.css">
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.7.1/dojox/grid/resources/claroGrid.css">
<div id="target-node-id"></div>

JavaScript

function fmtValues(values) {
    console.debug(values);
    return "***" + values + "***";
}

require(["dojo/ready",
             "dojo/store/Memory",
             "dojo/data/ObjectStore",
             "dojox/grid/DataGrid"], function(ready, Memory, ObjectStore, Grid) {

    ready(function() {

        myStore = new Memory({
            data: [
                {
                id: "value1",
                values: ["a", "b", "c"]},
            {
                id: "value2",
                values: "foo"}
            ]
        });

        dataStore = new ObjectStore({
            objectStore: myStore
        });

        grid = new Grid({
            store: dataStore,
            structure: [
                {
                name: "ID",
                field: "id",
                width: "200px"},
            {
                name: "Values",
                field: "values",
                width: "200px",
                formatter: fmtValues}
            ]
        }, "target-node-id");
        grid.startup();
    });
});