X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/3789b528d8dd8aad4558e38e22d775bcab1cbd36..refs/heads/master:/docs/output/Ext.Loader.js?ds=inline diff --git a/docs/output/Ext.Loader.js b/docs/output/Ext.Loader.js index 64a9c2b5..e56ddf11 100644 --- a/docs/output/Ext.Loader.js +++ b/docs/output/Ext.Loader.js @@ -1,378 +1 @@ -Ext.data.JsonP.Ext_Loader({ - "tagname": "class", - "name": "Ext.Loader", - "doc": "
Ext.Loader is the heart of the new dynamic dependency loading capability in Ext JS 4+. It is most commonly used\nvia the Ext.require shorthand. Ext.Loader supports both asynchronous and synchronous loading\napproaches, and leverage their advantages for the best development flow. We'll discuss about the pros and cons of each approach:
\n\nAdvantages:
\n\nfile://path/to/your/index\n.html
)Disadvantages:
\n\n// Syntax\nExt.require({String/Array} expressions);\n\n// Example: Single alias\nExt.require('widget.window');\n\n// Example: Single class name\nExt.require('Ext.window.Window');\n\n// Example: Multiple aliases / class names mix\nExt.require(['widget.window', 'layout.border', 'Ext.data.Connection']);\n\n// Wildcards\nExt.require(['widget.*', 'layout.*', 'Ext.data.*']);\n
\n\n// Syntax: Note that it must be in this chaining format.\nExt.exclude({String/Array} expressions)\n .require({String/Array} expressions);\n\n// Include everything except Ext.data.*\nExt.exclude('Ext.data.*').require('*');Â \n\n// Include all widgets except widget.checkbox*,\n// which will match widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.\nExt.exclude('widget.checkbox*').require('widget.*');\n
\n\nAdvantages:
\n\nDisadvantages:
\n\nThere's one simple rule to follow: Instantiate everything with Ext.create instead of the new
keyword
Ext.create('widget.window', { ... }); // Instead of new Ext.window.Window({...});\n\nExt.create('Ext.window.Window', {}); // Same as above, using full class name instead of alias\n\nExt.widget('window', {}); // Same as above, all you need is the traditional `xtype`\n
\n\nBehind the scene, Ext.ClassManager will automatically check whether the given class name / alias has already\n existed on the page. If it's not, Ext.Loader will immediately switch itself to synchronous mode and automatic load the given\n class and all its dependencies.
\n\nIt has all the advantages combined from asynchronous and synchronous loading. The development flow is simple:
\n\ndependencies on demand as they're needed during run-time. For example: ###
\n\nExt.onReady(function(){\n var window = Ext.createWidget('window', {\n width: 500,\n height: 300,\n layout: {\n type: 'border',\n padding: 5\n },\n title: 'Hello Dialog',\n items: [{\n title: 'Navigation',\n collapsible: true,\n region: 'west',\n width: 200,\n html: 'Hello',\n split: true\n }, {\n title: 'TabPanel',\n region: 'center'\n }]\n });\n\n window.show();\n})\n
\n\n[Ext.Loader] Synchronously loading 'Ext.window.Window'; consider adding Ext.require('Ext.window.Window') before your application's code\nClassManager.js:432\n[Ext.Loader] Synchronously loading 'Ext.layout.container.Border'; consider adding Ext.require('Ext.layout.container.Border') before your application's code\n
\n\nSimply copy and paste the suggested code above Ext.onReady
, i.e:
Ext.require('Ext.window.Window');\nExt.require('Ext.layout.container.Border');\n\nExt.onReady(...);\n
\n\nEverything should now load via asynchronous mode.
\n\nIt's important to note that dynamic loading should only be used during development on your local machines.\nDuring production, all dependencies should be combined into one single JavaScript file. Ext.Loader makes\nthe whole process of transitioning from / to between development / maintenance and production as easy as\npossible. Internally Ext.Loader.history maintains the list of all dependencies your application\nneeds in the exact loading sequence. It's as simple as concatenating all files in this array into one,\nthen include it on top of your application.
\n\nThis process will be automated with Sencha Command, to be released and documented towards Ext JS 4 Final.
\n", - "extends": null, - "mixins": [ - - ], - "alternateClassNames": [ - - ], - "xtype": null, - "author": "Jacky NguyenAppends current timestamp to script files to prevent caching\nDefaults to true
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 234, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-cfg-disableCaching" - }, - { - "tagname": "cfg", - "name": "disableCachingParam", - "member": "Ext.Loader", - "type": "String", - "doc": "The get parameter name for the cache buster's timestamp.\nDefaults to '_dc'
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 241, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-cfg-disableCachingParam" - }, - { - "tagname": "cfg", - "name": "enabled", - "member": "Ext.Loader", - "type": "Boolean", - "doc": "Whether or not to enable the dynamic dependency loading feature\nDefaults to false
\n", - "private": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 227, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-cfg-enabled" - }, - { - "tagname": "cfg", - "name": "paths", - "member": "Ext.Loader", - "type": "Object", - "doc": "The mapping from namespaces to file paths
\n\n{\n 'Ext': '.', // This is set by default, Ext.layout.container.Container will be\n // loaded from ./layout/Container.js\n\n 'My': './src/my_own_folder' // My.layout.Container will be loaded from\n // ./src/my_own_folder/layout/Container.js\n}\n
\n\nNote that all relative paths are relative to the current HTML document.\nIf not being specified, for example, Other.awesome.Class
\nwill simply be loaded from ./Other/awesome/Class.js
Explicitly exclude files from being loaded. Useful when used in conjunction with a broad include expression.\nCan be chained with more require
and exclude
methods, eg:
Ext.exclude('Ext.data.*').require('*');\n\nExt.exclude('widget.button*').require('widget.*');\n
\n",
- "params": [
- {
- "type": "Array",
- "name": "excludes",
- "doc": "\n",
- "optional": false
- }
- ],
- "return": {
- "type": "Object",
- "doc": "object contains require
method for chaining
Get the config value corresponding to the specified name. If no name is given, will return the config object
\n", - "params": [ - { - "type": "String", - "name": "name", - "doc": "The config property name
\n", - "optional": false - } - ], - "return": { - "type": "Object/Mixed", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 305, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-getConfig", - "shortDoc": "Get the config value corresponding to the specified name. If no name is given, will return the config object
\n" - }, - { - "tagname": "method", - "name": "getPath", - "member": "Ext.Loader", - "doc": "Translates a className to a file path by adding the\nthe proper prefix and converting the .'s to /'s. For example:
\n\nExt.Loader.setPath('My', '/path/to/My');\n\nalert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js'\n
\n\nNote that the deeper namespace levels, if explicitly set, are always resolved first. For example:
\n\nExt.Loader.setPath({\n 'My': '/path/to/lib',\n 'My.awesome': '/other/path/for/awesome/stuff',\n 'My.awesome.more': '/more/awesome/path'\n});\n\nalert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js'\n\nalert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js'\n\nalert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js'\n\nalert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js'\n
\n",
- "params": [
- {
- "type": "String",
- "name": "className",
- "doc": "\n",
- "optional": false
- }
- ],
- "return": {
- "type": "String",
- "doc": "path
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 343, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-getPath", - "shortDoc": "Translates a className to a file path by adding the\nthe proper prefix and converting the .'s to /'s. For example:\n\nEx..." - }, - { - "tagname": "method", - "name": "onReady", - "member": "Ext.Loader", - "doc": "Add a new listener to be executed when all required scripts are fully loaded
\n", - "params": [ - { - "type": "Function", - "name": "fn", - "doc": "The function callback to be executed
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "The execution scope (this
) of the callback function
Whether or not to wait for document dom ready as well
\n", - "optional": false - }, - { - "type": "Object", - "name": "options", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 902, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-onReady", - "shortDoc": "Add a new listener to be executed when all required scripts are fully loaded
\n" - }, - { - "tagname": "method", - "name": "require", - "member": "Ext.Loader", - "doc": "Loads all classes by the given names and all their direct dependencies; optionally executes the given callback function when\nfinishes, within the optional scope. This method is aliased by Ext.require for convenience
\n", - "params": [ - { - "type": "String/Array", - "name": "expressions", - "doc": "Can either be a string or an array of string
\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "(Optional) The callback function
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(Optional) The execution scope (this
) of the callback function
(Optional) Classes to be excluded, useful when being used with expressions
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 634, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-require", - "shortDoc": "Loads all classes by the given names and all their direct dependencies; optionally executes the given callback functi..." - }, - { - "tagname": "method", - "name": "setConfig", - "member": "Ext.Loader", - "doc": "Set the configuration for the loader. This should be called right after ext-core.js\n(or ext-core-debug.js) is included in the page, i.e:
\n\n<script type=\"text/javascript\" src=\"ext-core-debug.js\"></script>\n<script type=\"text/javascript\">\n Ext.Loader.setConfig({\n enabled: true,\n paths: {\n 'My': 'my_own_path'\n }\n });\n<script>\n<script type=\"text/javascript\">\n Ext.require(...);\n\n Ext.onReady(function() {\n // application code here\n });\n</script>\n
\n\nRefer to configs for the list of possible properties
\n", - "params": [ - { - "type": "Object", - "name": "config", - "doc": "The config object to override the default values in config
\n", - "optional": false - }, - { - "type": "Object", - "name": "value", - "doc": "\n", - "optional": false - } - ], - "return": { - "type": "Ext.Loader", - "doc": "this
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 267, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-setConfig", - "shortDoc": "Set the configuration for the loader. This should be called right after ext-core.js\n(or ext-core-debug.js) is include..." - }, - { - "tagname": "method", - "name": "setPath", - "member": "Ext.Loader", - "doc": "Sets the path of a namespace.\nFor Example:
\n\nExt.Loader.setPath('Ext', '.');\n
\n",
- "params": [
- {
- "type": "String/Object",
- "name": "name",
- "doc": "See flexSetter
\n", - "optional": false - }, - { - "type": "String", - "name": "path", - "doc": "See flexSetter
\n", - "optional": false - } - ], - "return": { - "type": "Ext.Loader", - "doc": "this
\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 318, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-setPath", - "shortDoc": "Sets the path of a namespace.\nFor Example:
\n\nExt.Loader.setPath('Ext', '.');\n
\n"
- },
- {
- "tagname": "method",
- "name": "syncRequire",
- "member": "Ext.Loader",
- "doc": "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. This method is aliased by Ext.syncRequire for convenience
\n", - "params": [ - { - "type": "String/Array", - "name": "expressions", - "doc": "Can either be a string or an array of string
\n", - "optional": false - }, - { - "type": "Function", - "name": "fn", - "doc": "(Optional) The callback function
\n", - "optional": false - }, - { - "type": "Object", - "name": "scope", - "doc": "(Optional) The execution scope (this
) of the callback function
(Optional) Classes to be excluded, useful when being used with expressions
\n", - "optional": false - } - ], - "return": { - "type": "void", - "doc": "\n" - }, - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 619, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-method-syncRequire", - "shortDoc": "Synchronously loads all classes by the given names and all their direct dependencies; optionally executes the given c..." - } - ], - "property": [ - { - "tagname": "property", - "name": "history", - "member": "Ext.Loader", - "type": "Array", - "doc": "An array of class names to keep track of the dependency loading order.\nThis is not guaranteed to be the same everytime due to the asynchronous\nnature of the Loader.
\n", - "private": false, - "static": false, - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 212, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader-property-history", - "shortDoc": "An array of class names to keep track of the dependency loading order.\nThis is not guaranteed to be the same everytim..." - } - ], - "event": [ - - ], - "filename": "/Users/nick/Projects/sencha/SDK/platform/core/src/class/Loader.js", - "linenr": 1, - "html_filename": "Loader.html", - "href": "Loader.html#Ext-Loader", - "cssVar": [ - - ], - "cssMixin": [ - - ], - "component": false, - "superclasses": [ - - ], - "subclasses": [ - - ], - "mixedInto": [ - - ], - "allMixins": [ - - ] -}); \ No newline at end of file +Ext.data.JsonP.Ext_Loader({"tagname":"class","html":"Files
Ext.Loader is the heart of the new dynamic dependency loading capability in Ext JS 4+. It is most commonly used\nvia the Ext.require shorthand. Ext.Loader supports both asynchronous and synchronous loading\napproaches, and leverage their advantages for the best development flow. We'll discuss about the pros and cons\nof each approach:
\n\nAdvantages:
\n\nfile://path/to/your/index.html
)Disadvantages:
\n\n// Syntax\nExt.require({String/Array} expressions);\n\n// Example: Single alias\nExt.require('widget.window');\n\n// Example: Single class name\nExt.require('Ext.window.Window');\n\n// Example: Multiple aliases / class names mix\nExt.require(['widget.window', 'layout.border', 'Ext.data.Connection']);\n\n// Wildcards\nExt.require(['widget.*', 'layout.*', 'Ext.data.*']);\n
\n\n// Syntax: Note that it must be in this chaining format.\nExt.exclude({String/Array} expressions)\n .require({String/Array} expressions);\n\n// Include everything except Ext.data.*\nExt.exclude('Ext.data.*').require('*');Â \n\n// Include all widgets except widget.checkbox*,\n// which will match widget.checkbox, widget.checkboxfield, widget.checkboxgroup, etc.\nExt.exclude('widget.checkbox*').require('widget.*');\n
\n\nAdvantages:
\n\nDisadvantages:
\n\nThere's one simple rule to follow: Instantiate everything with Ext.create instead of the new
keyword
Ext.create('widget.window', { ... }); // Instead of new Ext.window.Window({...});\n\nExt.create('Ext.window.Window', {}); // Same as above, using full class name instead of alias\n\nExt.widget('window', {}); // Same as above, all you need is the traditional `xtype`\n
\n\nBehind the scene, Ext.ClassManager will automatically check whether the given class name / alias has already\nexisted on the page. If it's not, Ext.Loader will immediately switch itself to synchronous mode and automatic load\nthe given class and all its dependencies.
\n\nIt has all the advantages combined from asynchronous and synchronous loading. The development flow is simple:
\n\nExt.Loader will automatically fetch all dependencies on demand as they're needed during run-time. For example:
\n\nExt.onReady(function(){\n var window = Ext.createWidget('window', {\n width: 500,\n height: 300,\n layout: {\n type: 'border',\n padding: 5\n },\n title: 'Hello Dialog',\n items: [{\n title: 'Navigation',\n collapsible: true,\n region: 'west',\n width: 200,\n html: 'Hello',\n split: true\n }, {\n title: 'TabPanel',\n region: 'center'\n }]\n });\n\n window.show();\n})\n
\n\n[Ext.Loader] Synchronously loading 'Ext.window.Window'; consider adding Ext.require('Ext.window.Window') before your application's code ClassManager.js:432\n[Ext.Loader] Synchronously loading 'Ext.layout.container.Border'; consider adding Ext.require('Ext.layout.container.Border') before your application's code\n
\n\nSimply copy and paste the suggested code above Ext.onReady
, e.g.:
Ext.require('Ext.window.Window');\nExt.require('Ext.layout.container.Border');\n\nExt.onReady(...);\n
\n\nEverything should now load via asynchronous mode.
\n\nIt's important to note that dynamic loading should only be used during development on your local machines.\nDuring production, all dependencies should be combined into one single JavaScript file. Ext.Loader makes\nthe whole process of transitioning from / to between development / maintenance and production as easy as\npossible. Internally Ext.Loader.history maintains the list of all dependencies\nyour application needs in the exact loading sequence. It's as simple as concatenating all files in this\narray into one, then include it on top of your application.
\n\nThis process will be automated with Sencha Command, to be released and documented towards Ext JS 4 Final.
\nAppends current timestamp to script files to prevent caching.
\nDefaults to: true
The get parameter name for the cache buster's timestamp.
\nDefaults to: "_dc"
Whether or not to enable the dynamic dependency loading feature.
\nDefaults to: false
The mapping from namespaces to file paths
\n\n{\n 'Ext': '.', // This is set by default, Ext.layout.container.Container will be\n // loaded from ./layout/Container.js\n\n 'My': './src/my_own_folder' // My.layout.Container will be loaded from\n // ./src/my_own_folder/layout/Container.js\n}\n
\n\nNote that all relative paths are relative to the current HTML document.\nIf not being specified, for example, Other.awesome.Class
\nwill simply be loaded from ./Other/awesome/Class.js
Defaults to: {"Ext": "."}
Explicitly exclude files from being loaded. Useful when used in conjunction with a broad include expression.\nCan be chained with more require
and exclude
methods, e.g.:
Ext.exclude('Ext.data.*').require('*');\n\nExt.exclude('widget.button*').require('widget.*');\n
\n\nExt.exclude is alias for Ext.Loader.exclude for convenience.
\nobject contains require
method for chaining
Translates a className to a file path by adding the the proper prefix and converting the .'s to /'s.\nFor example:
\n\nExt.Loader.setPath('My', '/path/to/My');\n\nalert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/path/to/My/awesome/Class.js'\n
\n\nNote that the deeper namespace levels, if explicitly set, are always resolved first. For example:
\n\nExt.Loader.setPath({\n 'My': '/path/to/lib',\n 'My.awesome': '/other/path/for/awesome/stuff',\n 'My.awesome.more': '/more/awesome/path'\n});\n\nalert(Ext.Loader.getPath('My.awesome.Class')); // alerts '/other/path/for/awesome/stuff/Class.js'\n\nalert(Ext.Loader.getPath('My.awesome.more.Class')); // alerts '/more/awesome/path/Class.js'\n\nalert(Ext.Loader.getPath('My.cool.Class')); // alerts '/path/to/lib/cool/Class.js'\n\nalert(Ext.Loader.getPath('Unknown.strange.Stuff')); // alerts 'Unknown/strange/Stuff.js'\n
\npath
\nLoads all classes by the given names and all their direct dependencies;\noptionally executes the given callback function when finishes, within the optional scope.
\n\nExt.require is alias for Ext.Loader.require for convenience.
\nCan either be a string or an array of string
\nThe callback function
\nThe execution scope (this
) of the callback function
Classes to be excluded, useful when being used with expressions
\nSet the configuration for the loader. This should be called right after ext-core.js\n(or ext-core-debug.js) is included in the page, e.g.:
\n\n<script type=\"text/javascript\" src=\"ext-core-debug.js\"></script>\n<script type=\"text/javascript\">\n Ext.Loader.setConfig({\n enabled: true,\n paths: {\n 'My': 'my_own_path'\n }\n });\n<script>\n<script type=\"text/javascript\">\n Ext.require(...);\n\n Ext.onReady(function() {\n // application code here\n });\n</script>\n
\n\nRefer to config options of Ext.Loader for the list of possible properties.
\nName of the value to override, or a config object to override multiple values.
\nThe new value to set, needed if first parameter is String.
\nthis
\nSets the path of a namespace. For Example:
\n\nExt.Loader.setPath('Ext', '.');\n
\nSee flexSetter
\nSee flexSetter
\nthis
\nSynchronously loads all classes by the given names and all their direct dependencies;\noptionally executes the given callback function when finishes, within the optional scope.
\n\nExt.syncRequire is alias for Ext.Loader.syncRequire for convenience.
\nCan either be a string or an array of string
\nThe callback function
\nThe execution scope (this
) of the callback function
Classes to be excluded, useful when being used with expressions
\n