dojo 为什么dgrid渲染hello world教程中的网格不正确

wbrvyc0a  于 2022-12-16  发布在  Dojo
关注(0)|答案(1)|浏览(137)

这只显示基本的html行和列,但显然我需要dgrids行和列。这是dgrids hello world教程中的确切代码。

<!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>

字符串

bjg7j2ky

bjg7j2ky1#

上面的代码缺少the tutorial中的第6行:

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

相关问题