Gunther Schaaf
Gunther Schaaf

Reputation: 1

Why isn't dgrid rendering correct grid from hello world tutorial

This only displays barebones html rows and columns but obviously I need dgrids rows and columns. This is the exact code from dgrids hello world tutorial.

<!DOCTYPE html>
   <html>
   <head>
       <meta charset="utf-8">
       <title>Tutorial: Hello dgrid!</title>
   </head>
   <body>
       <div id="grid"></div>
       <!-- this configuration assumes that the dgrid package is located
           in the filesystem as a sibling to the dojo package -->
      <script src="/Users/theUser/node_modules/dojo/dojo.js"
          data-dojo-config="async: true"></script>
      <script>
  require([ 'dgrid/Grid', 'dojo/domReady!' ], function (Grid) {
      var data = [
          { first: 'Bob', last: 'Barker', age: 89 },
          { first: 'Vanna', last: 'White', age: 55 },
          { first: 'Pat', last: 'Sajak', age: 65 }
      ];
      var grid = new Grid({
          columns: { 
              first: 'First Name',
              last: 'Last Name',
              age: 'Age'
          }
      }, 'grid');
      grid.renderArray(data);
  });
      </script>
  </body>
  </html>

Upvotes: 0

Views: 44

Answers (1)

The code above is missing line 6 from the tutorial:

<link rel="stylesheet" href="path/to/dgrid/css/dgrid.css">

Upvotes: 0

Related Questions