Alien-Web-ExtJS-V3

 view release on metacpan or  search on metacpan

share/docs/source/DataProxy.html  view on Meta::CPAN

myStore.on({
    beforeload: {
        fn: function (store, options) {
            // use <tt>{@link Ext.data.HttpProxy#setUrl setUrl}</tt> to change the URL for *just* this request.
            store.proxy.setUrl('changed1.php');

            // set optional second parameter to true to make this URL change
            // permanent, applying this URL for all subsequent requests.
            store.proxy.setUrl('changed1.php', true);

            // Altering the proxy API should be done using the public
            // method <tt>{@link Ext.data.DataProxy#setApi setApi}</tt>.
            store.proxy.setApi('read', 'changed2.php');

            // Or set the entire API with a config-object.
            // When using the config-object option, you must redefine the <b>entire</b>
            // API -- not just a specific action of it.
            store.proxy.setApi({
                read    : 'changed_read.php',
                create  : 'changed_create.php',
                update  : 'changed_update.php',
                destroy : 'changed_destroy.php'
            });
        }
    }
});
     * </code></pre>
     * </p>
     */

    this.addEvents(
<span id='Ext-data-DataProxy-event-exception'>        /**
</span>         * @event exception
         * &lt;p&gt;Fires if an exception occurs in the Proxy during a remote request. This event is relayed
         * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception},
         * so any Store instance may observe this event.&lt;/p&gt;
         * &lt;p&gt;In addition to being fired through the DataProxy instance that raised the event, this event is also fired
         * through the Ext.data.DataProxy &lt;i&gt;class&lt;/i&gt; to allow for centralized processing of exception events from &lt;b&gt;all&lt;/b&gt;
         * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.&lt;/p&gt;
         * &lt;p&gt;This event can be fired for one of two reasons:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;remote-request &lt;b&gt;failed&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * The server did not return status === 200.
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;remote-request &lt;b&gt;succeeded&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * The remote-request succeeded but the reader could not read the response.
         * This means the server returned data, but the configured Reader threw an
         * error while reading the response.  In this case, this event will be
         * raised and the caught error will be passed along into this event.
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * &lt;br&gt;&lt;p&gt;This event fires with two different contexts based upon the 2nd
         * parameter &lt;tt&gt;type [remote|response]&lt;/tt&gt;.  The first four parameters
         * are identical between the two contexts -- only the final two parameters
         * differ.&lt;/p&gt;
         * @param {DataProxy} this The proxy that sent the request
         * @param {String} type
         * &lt;p&gt;The value of this parameter will be either &lt;tt&gt;'response'&lt;/tt&gt; or &lt;tt&gt;'remote'&lt;/tt&gt;.&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;An &lt;b&gt;invalid&lt;/b&gt; response from the server was returned: either 404,
         * 500 or the response meta-data does not match that defined in the DataReader
         * (e.g.: root, idProperty, successProperty).&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;A &lt;b&gt;valid&lt;/b&gt; response was returned from the server having
         * successProperty === false.  This response might contain an error-message
         * sent from the server.  For example, the user may have failed
         * authentication/authorization or a database validation error occurred.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * @param {String} action Name of the action (see {@link Ext.data.Api#actions}.
         * @param {Object} options The options for the action that were specified in the {@link #request}.
         * @param {Object} response
         * &lt;p&gt;The value of this parameter depends on the value of the &lt;code&gt;type&lt;/code&gt; parameter:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The raw browser response object (e.g.: XMLHttpRequest)&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : &lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The decoded response object sent from the server.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         * @param {Mixed} arg
         * &lt;p&gt;The type and value of this parameter depends on the value of the &lt;code&gt;type&lt;/code&gt; parameter:&lt;/p&gt;
         * &lt;div class=&quot;mdetail-params&quot;&gt;&lt;ul&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'response'&lt;/tt&gt;&lt;/b&gt; : Error&lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;The JavaScript Error object caught if the configured Reader could not read the data.
         * If the remote request returns success===false, this parameter will be null.&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;li&gt;&lt;b&gt;&lt;tt&gt;'remote'&lt;/tt&gt;&lt;/b&gt; : Record/Record[]&lt;div class=&quot;sub-desc&quot;&gt;
         * &lt;p&gt;This parameter will only exist if the &lt;tt&gt;action&lt;/tt&gt; was a &lt;b&gt;write&lt;/b&gt; action
         * (Ext.data.Api.actions.create|update|destroy).&lt;/p&gt;
         * &lt;/div&gt;&lt;/li&gt;
         * &lt;/ul&gt;&lt;/div&gt;
         */
        'exception',
<span id='Ext-data-DataProxy-event-beforeload'>        /**
</span>         * @event beforeload
         * Fires before a request to retrieve a data object.
         * @param {DataProxy} this The proxy for the request
         * @param {Object} params The params object passed to the {@link #request} function
         */
        'beforeload',
<span id='Ext-data-DataProxy-event-load'>        /**
</span>         * @event load
         * Fires before the load method's callback is called.
         * @param {DataProxy} this The proxy for the request
         * @param {Object} o The request transaction object
         * @param {Object} options The callback's &lt;tt&gt;options&lt;/tt&gt; property as passed to the {@link #request} function
         */
        'load',
<span id='Ext-data-DataProxy-event-loadexception'>        /**
</span>         * @event loadexception
         * &lt;p&gt;This event is &lt;b&gt;deprecated&lt;/b&gt;.  The signature of the loadexception event
         * varies depending on the proxy, use the catch-all {@link #exception} event instead.
         * This event will fire in addition to the {@link #exception} event.&lt;/p&gt;
         * @param {misc} misc See {@link #exception}.
         * @deprecated
         */
        'loadexception',



( run in 1.353 second using v1.01-cache-2.11-cpan-39bf76dae61 )