Ext.data.JsonP.Ext_ux_ajax_SimManager({"mixins":[],"code_type":"ext_define","inheritable":false,"component":false,"meta":{"author":["Don Griffin"]},"mixedInto":[],"uses":[],"aliases":{},"parentMixins":[],"superclasses":["Ext.Base"],"members":{"event":[],"property":[{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"$className","id":"property-S-className"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"configMap","id":"property-configMap"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigList","id":"property-initConfigList"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"initConfigMap","id":"property-initConfigMap"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"property","name":"isInstance","id":"property-isInstance"},{"meta":{"private":true},"owner":"Ext.ux.ajax.SimManager","tagname":"property","name":"ready","id":"property-ready"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"property","name":"self","id":"property-self"}],"css_var":[],"method":[{"meta":{"deprecated":{"text":"as of 4.1. Use {@link #callParent} instead."},"protected":true},"owner":"Ext.Base","tagname":"method","name":"callOverridden","id":"method-callOverridden"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"callParent","id":"method-callParent"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"configClass","id":"method-configClass"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"destroy","id":"method-destroy"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"getConfig","id":"method-getConfig"},{"meta":{},"owner":"Ext.Base","tagname":"method","name":"getInitialConfig","id":"method-getInitialConfig"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"hasConfig","id":"method-hasConfig"},{"meta":{"markdown":true},"owner":"Ext.ux.ajax.SimManager","tagname":"method","name":"init","id":"method-init"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"initConfig","id":"method-initConfig"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"onConfigUpdate","id":"method-onConfigUpdate"},{"meta":{"markdown":true},"owner":"Ext.ux.ajax.SimManager","tagname":"method","name":"register","id":"method-register"},{"meta":{"private":true},"owner":"Ext.Base","tagname":"method","name":"setConfig","id":"method-setConfig"},{"meta":{"protected":true},"owner":"Ext.Base","tagname":"method","name":"statics","id":"method-statics"}],"css_mixin":[],"cfg":[{"meta":{},"owner":"Ext.ux.ajax.SimManager","tagname":"cfg","name":"defaultSimlet","id":"cfg-defaultSimlet"},{"meta":{},"owner":"Ext.ux.ajax.SimManager","tagname":"cfg","name":"defaultType","id":"cfg-defaultType"},{"meta":{},"owner":"Ext.ux.ajax.SimManager","tagname":"cfg","name":"delay","id":"cfg-delay"}]},"tagname":"class","extends":"Ext.Base","html":"

Hierarchy

Ext.Base
Ext.ux.ajax.SimManager

Requires

Files

This singleton manages simulated Ajax responses. This allows application logic to be\nwritten unaware that its Ajax calls are being handled by simulations (\"simlets\"). This\nis currently done by hooking Ext.data.Connection methods, so all users of that\nclass (and Ext.Ajax since it is a derived class) qualify for simulation.

\n\n

The requires hooks are inserted when either the init method is called or the\nfirst Ext.ux.ajax.Simlet is registered. For example:

\n\n
 Ext.onReady(function () {\n     initAjaxSim();\n\n     // normal stuff\n });\n\n function initAjaxSim () {\n     Ext.ux.ajax.SimManager.init({\n         delay: 300\n     }).register({\n         '/app/data/url': {\n             stype: 'json',  // use JsonSimlet (stype is like xtype for components)\n             data: [\n                 { foo: 42, bar: 'abc' },\n                 ...\n             ]\n         }\n     });\n }\n
\n\n

As many URL's as desired can be registered and associated with a Ext.ux.ajax.Simlet. To make\nnon-simulated Ajax requests once this singleton is initialized, add a nosim:true option\nto the Ajax options:

\n\n
 Ext.Ajax.request({\n     url: 'page.php',\n     nosim: true, // ignored by normal Ajax request\n     params: {\n         id: 1\n     },\n     success: function(response){\n         var text = response.responseText;\n         // process server response here\n     }\n });\n
\n
Defined By

Config options

The Ext.ux.ajax.Simlet instance to use for non-matching URL's. ...

The Ext.ux.ajax.Simlet instance to use for non-matching URL's. By default, this will\nreturn 404. Set this to null to use real Ajax calls for non-matching URL's.

\n
Ext.ux.ajax.SimManager
view source
: String
The default stype to apply to generic Ext.ux.ajax.Simlet configuration objects. ...

The default stype to apply to generic Ext.ux.ajax.Simlet configuration objects. The\ndefault is 'basic'.

\n

Defaults to: "basic"

Ext.ux.ajax.SimManager
view source
: Number
The number of milliseconds to delay before delivering a response to an async request. ...

The number of milliseconds to delay before delivering a response to an async request.

\n

Defaults to: 150

Defined By

Properties

...
\n

Defaults to: "Ext.Base"

...
\n

Defaults to: {}

...
\n

Defaults to: []

...
\n

Defaults to: {}

...
\n

Defaults to: true

Ext.ux.ajax.SimManager
view source
: Booleanprivate
@prop {Boolean} ready\nTrue once this singleton has initialized and applied its Ajax hooks. ...

@prop {Boolean} ready\nTrue once this singleton has initialized and applied its Ajax hooks.

\n

Defaults to: false

Get the reference to the current class from which this object was instantiated. ...

Get the reference to the current class from which this object was instantiated. Unlike statics,\nthis.self is scope-dependent and it's meant to be used for dynamic inheritance. See statics\nfor a detailed comparison

\n\n
Ext.define('My.Cat', {\n    statics: {\n        speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n    },\n\n    constructor: function() {\n        alert(this.self.speciesName); // dependent on 'this'\n    },\n\n    clone: function() {\n        return new this.self();\n    }\n});\n\n\nExt.define('My.SnowLeopard', {\n    extend: 'My.Cat',\n    statics: {\n        speciesName: 'Snow Leopard'         // My.SnowLeopard.speciesName = 'Snow Leopard'\n    }\n});\n\nvar cat = new My.Cat();                     // alerts 'Cat'\nvar snowLeopard = new My.SnowLeopard();     // alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone));             // alerts 'My.SnowLeopard'\n
\n
Defined By

Methods

( Array/Arguments args ) : Objectdeprecatedprotected
Call the original method that was previously overridden with override\n\nExt.define('My.Cat', {\n constructor: functi...

Call the original method that was previously overridden with override

\n\n
Ext.define('My.Cat', {\n    constructor: function() {\n        alert(\"I'm a cat!\");\n    }\n});\n\nMy.Cat.override({\n    constructor: function() {\n        alert(\"I'm going to be a cat!\");\n\n        this.callOverridden();\n\n        alert(\"Meeeeoooowwww\");\n    }\n});\n\nvar kitty = new My.Cat(); // alerts \"I'm going to be a cat!\"\n                          // alerts \"I'm a cat!\"\n                          // alerts \"Meeeeoooowwww\"\n
\n
\n

This method has been deprecated

\n

as of 4.1. Use callParent instead.

\n\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callOverridden(arguments)

    \n

Returns

  • Object

    Returns the result of calling the overridden method

    \n
( Array/Arguments args ) : Objectprotected
Call the \"parent\" method of the current method. ...

Call the \"parent\" method of the current method. That is the method previously\noverridden by derivation or by an override (see Ext.define).

\n\n
 Ext.define('My.Base', {\n     constructor: function (x) {\n         this.x = x;\n     },\n\n     statics: {\n         method: function (x) {\n             return x;\n         }\n     }\n });\n\n Ext.define('My.Derived', {\n     extend: 'My.Base',\n\n     constructor: function () {\n         this.callParent([21]);\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // alerts 21\n
\n\n

This can be used with an override as follows:

\n\n
 Ext.define('My.DerivedOverride', {\n     override: 'My.Derived',\n\n     constructor: function (x) {\n         this.callParent([x*2]); // calls original My.Derived constructor\n     }\n });\n\n var obj = new My.Derived();\n\n alert(obj.x);  // now alerts 42\n
\n\n

This also works with static methods.

\n\n
 Ext.define('My.Derived2', {\n     extend: 'My.Base',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Base.method\n         }\n     }\n });\n\n alert(My.Base.method(10);     // alerts 10\n alert(My.Derived2.method(10); // alerts 20\n
\n\n

Lastly, it also works with overridden static methods.

\n\n
 Ext.define('My.Derived2Override', {\n     override: 'My.Derived2',\n\n     statics: {\n         method: function (x) {\n             return this.callParent([x*2]); // calls My.Derived2.method\n         }\n     }\n });\n\n alert(My.Derived2.method(10); // now alerts 40\n
\n

Parameters

  • args : Array/Arguments

    The arguments, either an array or the arguments object\nfrom the current method, for example: this.callParent(arguments)

    \n

Returns

  • Object

    Returns the result of calling the parent method

    \n
...
\n

Parameters

Returns the initial configuration passed to constructor when instantiating\nthis class. ...

Returns the initial configuration passed to constructor when instantiating\nthis class.

\n

Parameters

  • name : String (optional)

    Name of the config option to return.

    \n

Returns

  • Object/Mixed

    The full config object or a single config value\nwhen name parameter specified.

    \n
...
\n

Parameters

Ext.ux.ajax.SimManager
view source
( Object config ) : Ext.ux.ajax.SimManager
Initializes this singleton and applies configuration options. ...

Initializes this singleton and applies configuration options.

\n

Parameters

  • config : Object

    An optional object with configuration properties to apply.

    \n

Returns

Initialize configuration for this class. ...

Initialize configuration for this class. a typical example:

\n\n
Ext.define('My.awesome.Class', {\n    // The default config\n    config: {\n        name: 'Awesome',\n        isAwesome: true\n    },\n\n    constructor: function(config) {\n        this.initConfig(config);\n    }\n});\n\nvar awesome = new My.awesome.Class({\n    name: 'Super Awesome'\n});\n\nalert(awesome.getName()); // 'Super Awesome'\n
\n

Parameters

Returns

( Object names, Object callback, Object scope )private
...
\n

Parameters

Ext.ux.ajax.SimManager
view source
( Array/Object simlet )
Registeres one or more Ext.ux.ajax.Simlet instances. ...

Registeres one or more Ext.ux.ajax.Simlet instances.

\n

Parameters

( Object config, Object applyIfNotSet )private
...
\n

Parameters

Get the reference to the class from which this object was instantiated. ...

Get the reference to the class from which this object was instantiated. Note that unlike self,\nthis.statics() is scope-independent and it always returns the class from which it was called, regardless of what\nthis points to during run-time

\n\n
Ext.define('My.Cat', {\n    statics: {\n        totalCreated: 0,\n        speciesName: 'Cat' // My.Cat.speciesName = 'Cat'\n    },\n\n    constructor: function() {\n        var statics = this.statics();\n\n        alert(statics.speciesName);     // always equals to 'Cat' no matter what 'this' refers to\n                                        // equivalent to: My.Cat.speciesName\n\n        alert(this.self.speciesName);   // dependent on 'this'\n\n        statics.totalCreated++;\n    },\n\n    clone: function() {\n        var cloned = new this.self;                      // dependent on 'this'\n\n        cloned.groupName = this.statics().speciesName;   // equivalent to: My.Cat.speciesName\n\n        return cloned;\n    }\n});\n\n\nExt.define('My.SnowLeopard', {\n    extend: 'My.Cat',\n\n    statics: {\n        speciesName: 'Snow Leopard'     // My.SnowLeopard.speciesName = 'Snow Leopard'\n    },\n\n    constructor: function() {\n        this.callParent();\n    }\n});\n\nvar cat = new My.Cat();                 // alerts 'Cat', then alerts 'Cat'\n\nvar snowLeopard = new My.SnowLeopard(); // alerts 'Cat', then alerts 'Snow Leopard'\n\nvar clone = snowLeopard.clone();\nalert(Ext.getClassName(clone));         // alerts 'My.SnowLeopard'\nalert(clone.groupName);                 // alerts 'Cat'\n\nalert(My.Cat.totalCreated);             // alerts 3\n
\n

Returns

","subclasses":[],"name":"Ext.ux.ajax.SimManager","alternateClassNames":[],"inheritdoc":null,"files":[{"href":"SimManager.html#Ext-ux-ajax-SimManager","filename":"SimManager.js"}],"html_meta":{"author":null},"singleton":true,"id":"class-Ext.ux.ajax.SimManager","statics":{"property":[],"event":[],"css_var":[],"method":[],"css_mixin":[],"cfg":[]},"requires":["Ext.data.Connection","Ext.ux.ajax.SimXhr","Ext.ux.ajax.Simlet","Ext.ux.ajax.JsonSimlet"]});