-
Notifications
You must be signed in to change notification settings - Fork 0
Inter library Dependencies
Home > Widget-Libraries > Inter-library Dependencies
If you are creating a widget library for a JS lib that depends on another JS lib, you may wish to re-use/extend from the metadata and helper code in the "ancestor" library.
In order to facilitate this, Maqetta registers an AMD module namespace for each widget library's metadata files. The general format of that namespace is:
maq-metadata-<lib name>-<lib version>
, where lib name is the library's "simple" name (i.e. "dojo") and lib version is the library's version string with periods replaced with underscores (i.e. "1_8_1").
For example, take a look at the GridX library, which depends on Dojo. If you look at the metadata/gridx/GridHelper.js
, you will see that it extends metadata/dojox/grid/DataGridHelper.js
from the Dojo library, using this AMD module reference:
"maq-metadata-dojo-1_8/dojox/grid/DataGridHelper"
In widgets.json, since the values for "helper", "tool" and "inlineEdit" are AMD module paths, you can also reference the code from other libraries for those properties:
"helper": "maq-metadata-dojo-1_8/dojox/grid/DataGridHelper"