X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..HEAD:/src/ElementLoader.js diff --git a/src/ElementLoader.js b/src/ElementLoader.js index c0ce37d0..7ec6cc34 100644 --- a/src/ElementLoader.js +++ b/src/ElementLoader.js @@ -13,21 +13,18 @@ If you are unsure which license is appropriate for your use, please contact the */ /** - * @class Ext.ElementLoader * A class used to load remote content to an Element. Sample usage: - *
-Ext.get('el').load({
- url: 'myPage.php',
- scripts: true,
- params: {
- id: 1
- }
-});
- *
- * - * In general this class will not be instanced directly, rather the {@link Ext.core.Element#load} method + * + * Ext.get('el').load({ + * url: 'myPage.php', + * scripts: true, + * params: { + * id: 1 + * } + * }); + * + * In general this class will not be instanced directly, rather the {@link Ext.Element#load} method * will be used. - *
*/ Ext.define('Ext.ElementLoader', { @@ -41,81 +38,109 @@ Ext.define('Ext.ElementLoader', { 'Ext.data.Connection', 'Ext.Ajax' ], - + statics: { Renderer: { Html: function(loader, response, active){ loader.getTarget().update(response.responseText, active.scripts === true); return true; } - } + } }, /* End Definitions */ /** - * @cfg {String} url The url to retrieve the content from. Defaults to null. + * @cfg {String} url + * The url to retrieve the content from. */ url: null, /** - * @cfg {Object} params Any params to be attached to the Ajax request. These parameters will - * be overridden by any params in the load options. Defaults to null. + * @cfg {Object} params + * Any params to be attached to the Ajax request. These parameters will + * be overridden by any params in the load options. */ params: null, /** * @cfg {Object} baseParams Params that will be attached to every request. These parameters - * will not be overridden by any params in the load options. Defaults to null. + * will not be overridden by any params in the load options. */ baseParams: null, /** - * @cfg {Boolean/Object} autoLoad True to have the loader make a request as soon as it is created. Defaults to false. + * @cfg {Boolean/Object} autoLoad + * True to have the loader make a request as soon as it is created. * This argument can also be a set of options that will be passed to {@link #load} is called. */ autoLoad: false, /** - * @cfg {Mixed} target The target element for the loader. It can be the DOM element, the id or an Ext.Element. + * @cfg {HTMLElement/Ext.Element/String} target + * The target element for the loader. It can be the DOM element, the id or an {@link Ext.Element}. */ target: null, /** - * @cfg {Mixed} loadMask True or a string to show when the element is loading. + * @cfg {Boolean/String} loadMask + * True or a string to show when the element is loading. */ loadMask: false, /** - * @cfg {Object} ajaxOptions Any additional options to be passed to the request, for example timeout or headers. Defaults to null. + * @cfg {Object} ajaxOptions + * Any additional options to be passed to the request, for example timeout or headers. */ ajaxOptions: null, - + /** - * @cfg {Boolean} scripts True to parse any inline script tags in the response. + * @cfg {Boolean} scripts + * True to parse any inline script tags in the response. */ scripts: false, /** - * @cfg {Function} success A function to be called when a load request is successful. + * @cfg {Function} success + * A function to be called when a load request is successful. + * Will be called with the following config parameters: + * + * - this - The ElementLoader instance. + * - response - The response object. + * - options - Ajax options. */ /** * @cfg {Function} failure A function to be called when a load request fails. + * Will be called with the following config parameters: + * + * - this - The ElementLoader instance. + * - response - The response object. + * - options - Ajax options. */ /** - * @cfg {Object} scope The scope to execute the {@link #success} and {@link #failure} functions in. + * @cfg {Function} callback A function to be called when a load request finishes. + * Will be called with the following config parameters: + * + * - this - The ElementLoader instance. + * - success - True if successful request. + * - response - The response object. + * - options - Ajax options. */ - + + /** + * @cfg {Object} scope + * The scope to execute the {@link #success} and {@link #failure} functions in. + */ + /** - * @cfg {Function} renderer A custom function to render the content to the element. The passed parameters - * are - *