Saturday 15 September 2012

javascript - How to load Dojo modules defined in the same file -


I have this good module, which loads and adds data grid.

  is required (('dojo / _base / lang', 'dojox / grid / datagrid', 'dojo / dom', 'dojo / domREeady!'], Function (lang, Datagrid, dom)) {var data = {.....});   

I would like to have all my dependencies a stay on self-contained file

  & lt; Script & gt; ** /dom/dom.js defined here & lt; / Script & gt; & Lt; Script & gt; ** Dodgex / Grid / DataGrid.JS defined here ** & lt; / Script & gt; & Lt; Script & gt; ** Data Grid Module Here *** & lt; / Script & gt;   

i.e. I do not want any reference to external or local file systems. It is not for a website. I want to use the Dojo widget in a single user desktop app.

The best way to create all your necessary files in a file using the Dojo Build Tool Will happen. Just add all the files / modules as a layer in the XML file and it is necessary to create it.

In this way you can retain all the required file inventory in the XML file and you can run the build tool to create a large JS file that you can always include in the desktop app.

Add a layer as such

  Layers: {"all / all": {"Dojo / dojo", "dojo / I18n "," dojo / ready "," dojo / domReady "]}}    

No comments:

Post a Comment