custom widget (data grid) dgrid throws 404: /mxclientsystem/dgrid/Grid.js not found

I am trying to create the custom data grid widget using “dgrid”.  I have installed dgrid using npm “npm install dgrid” and able to see dgrid dependencies in “node_modules”. I am getting 404 error when using this widget. http://localhost:8080/mxclientsystem/dgrid/Grid.js?636837510991622389 net::ERR_ABORTED 404 (Not Found) The below is the code used for require function. 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); }); Please let me know if I am missing something.
1 answers

I think the widget toolkit you’re using will not bundle dependencies of the widget.

Try this widget scaffolder, which lets you use ES6 notation and will bundle external dependencies: