Class type Ext_Loader.t


class type t = object .. end

method history : 'a. 'a Js.js_array Js.t Js.prop

An array of class names to keep track of the dependency loading order. This is not guaranteed to be the same everytime due to the asynchronous nature of the Loader.


method addClassPathMappings : 'b.
'b Js.t ->
(< addClassPathMappings : 'b. 'c;
exclude : 'e 'f. 'e Js.js_array Js.t -> 'f Js.t Js.meth;
getConfig : 'g. Js.js_string Js.t -> 'g Js.t Js.meth;
getPath : Js.js_string Js.t -> Js.js_string Js.t Js.meth;
history : 'a. 'a Js.js_array Js.t Js.prop;
loadScript : 'h. 'h Js.t -> unit Js.meth;
onReady : 'i 'j. 'i Js.callback -> 'j Js.t -> bool Js.t -> unit Js.meth;
require : 'k 'l 'm 'n.
'k Js.t ->
'l Js.callback Js.optdef ->
'm Js.t Js.optdef -> 'n Js.t Js.optdef -> unit Js.meth;
setConfig : 'o. 'o Js.t -> 'd Js.t Js.meth;
setPath : 'p. 'p Js.t -> Js.js_string Js.t Js.optdef -> 'd Js.t Js.meth;
syncRequire : 'q 'r 's 't.
'q Js.t ->
'r Js.callback Js.optdef ->
's Js.t Js.optdef -> 't Js.t Js.optdef -> unit Js.meth;
.. >
as 'd)
Js.t Js.meth as 'c

Sets a batch of path entries

Parameters:

Returns:


method exclude : 'e 'f. 'e Js.js_array Js.t -> 'f Js.t Js.meth

Explicitly exclude files from being loaded. Useful when used in conjunction with a broad include expression. Can be chained with more require and exclude methods, eg:

Ext.exclude('Ext.data.*').require('*');

Ext.exclude('widget.button*').require('widget.*');

Ext.exclude is alias for exclude.

Parameters:

Returns:


method getConfig : 'g. Js.js_string Js.t -> 'g Js.t Js.meth

Get the config value corresponding to the specified name. If no name is given, will return the config object

Parameters:


method getPath : Js.js_string Js.t -> Js.js_string Js.t Js.meth

Translates a className to a file path by adding the the proper prefix and converting the .'s to /'s. For example:

Ext.Loader.setPath('My', '/path/to/My');

alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js'

Note that the deeper namespace levels, if explicitly set, are always resolved first. For example:

Ext.Loader.setPath({
    'My': '/path/to/lib',
    'My.awesome': '/other/path/for/awesome/stuff',
    'My.awesome.more': '/more/awesome/path'
});

alert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js'

alert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js'

alert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js'

alert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js'

Parameters:

Returns:


method loadScript : 'h. 'h Js.t -> unit Js.meth

Loads the specified script URL and calls the supplied callbacks. If this method is called before Ext.isReady, the script's load will delay the transition to ready. This can be used to load arbitrary scripts that may contain further Ext.require calls.

Parameters:


method onReady : 'i 'j. 'i Js.callback -> 'j Js.t -> bool Js.t -> unit Js.meth

Add a new listener to be executed when all required scripts are fully loaded

Parameters:


method require : 'k 'l 'm 'n.
'k Js.t ->
'l Js.callback Js.optdef ->
'm Js.t Js.optdef -> 'n Js.t Js.optdef -> unit Js.meth

Loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when finishes, within the optional scope.

Ext.require is alias for require.

Parameters:


method setConfig : 'o. 'o Js.t -> 'd Js.t Js.meth

Set the configuration for the loader. This should be called right after ext-(debug).js is included in the page, and before Ext.onReady. i.e:

<script type="text/javascript" src="ext-core-debug.js"></script>
<script type="text/javascript">
    Ext.Loader.setConfig({
      enabled: true,
      paths: {
          'My': 'my_own_path'
      }
    });
</script>
<script type="text/javascript">
    Ext.require(...);

    Ext.onReady(function() {
      // application code here
    });
</script>

Refer to config options of Ext.Loader for the list of possible properties

Parameters:

Returns:


method setPath : 'p. 'p Js.t -> Js.js_string Js.t Js.optdef -> 'd Js.t Js.meth

Sets the path of a namespace. For Example:

Ext.Loader.setPath('Ext', '.');

Parameters:

Returns:


method syncRequire : 'q 'r 's 't.
'q Js.t ->
'r Js.callback Js.optdef ->
's Js.t Js.optdef -> 't Js.t Js.optdef -> unit Js.meth

Synchronously loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when finishes, within the optional scope.

Ext.syncRequire is alias for syncRequire.

Parameters: