Module Ext_ComponentLoader


module Ext_ComponentLoader: sig .. end
This class is used to load content via Ajax into a ...

This class is used to load content via Ajax into a Ext.Component. In general this class will not be instanced directly, rather a loader configuration will be passed to the constructor of the Ext.Component.

HTML Renderer

By default, the content loaded will be processed as raw html. The response text from the request is taken and added to the component. This can be used in conjunction with the scripts option to execute any inline scripts in the resulting content. Using this renderer has the same effect as passing the Ext.Component.html configuration option.

Data Renderer

This renderer allows content to be added by using JSON data and a Ext.XTemplate. The content received from the response is passed to the Ext.Component.update method. This content is run through the attached Ext.Component.tpl and the data is added to the Component. Using this renderer has the same effect as using the Ext.Component.data configuration in conjunction with a Ext.Component.tpl.

Component Renderer

This renderer can only be used with a Ext.container.Container and subclasses. It allows for Components to be loaded remotely into a Container. The response is expected to be a single/series of Ext.Component configuration objects. When the response is received, the data is decoded and then passed to Ext.container.Container.add. Using this renderer has the same effect as specifying the Ext.container.Container.items configuration on a Container.

Custom Renderer

A custom function can be passed to handle any other special case, see the renderer option.

Example Usage

var cmp = Ext.create('Ext.Component', {
    renderTo: Ext.getBody(),
    tpl: '{firstName} - {lastName}',
    loader: {
        url: 'myPage.php',
        renderer: 'data',
        params: {
            userId: 1
        }
    }
});

// call the loader manually (or use autoLoad:true instead)
cmp.getLoader().load();


class type t = object .. end
class type configs = object .. end
class type events = object .. end
class type statics = object .. end
val of_configs : configs Js.t -> t Js.t
of_configs c casts a config object c to an instance of class t
val to_configs : t Js.t -> configs Js.t
to_configs o casts instance o of class t to a config object