/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_direct_RemotingProvider({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":[],"extends":"Ext.direct.JsonProvider","uses":[],"html":"

Hierarchy

Files

The RemotingProvider exposes access to\nserver side methods on the client (a remote procedure call (RPC) type of\nconnection where the client can initiate a procedure on the server).

\n\n\n\n\n

This allows for code to be organized in a fashion that is maintainable,\nwhile providing a clear path between client and server, something that is\nnot always apparent when using URLs.

\n\n\n\n\n

To accomplish this the server-side needs to describe what classes and methods\nare available on the client-side. This configuration will typically be\noutputted by the server-side Ext.Direct stack when the API description is built.

\n\n
Defined By

Config options

Ext.direct.RemotingProvider
view source
: Object
Object literal defining the server side actions and methods. ...

Object literal defining the server side actions and methods. For example, if\nthe Provider is configured with:

\n\n
\"actions\":{ // each property within the 'actions' object represents a server side Class \n    \"TestAction\":[ // array of methods within each server side Class to be   \n    {              // stubbed out on client\n        \"name\":\"doEcho\", \n        \"len\":1            \n    },{\n        \"name\":\"multiply\",// name of method\n        \"len\":2           // The number of parameters that will be used to create an\n                          // array of data to send to the server side function.\n                          // Ensure the server sends back a Number, not a String. \n    },{\n        \"name\":\"doForm\",\n        \"formHandler\":true, // direct the client to use specialized form handling method \n        \"len\":1\n    }]\n}\n
\n\n\n

Note that a Store is not required, a server method can be called at any time.\nIn the following example a client side handler is used to call the\nserver side method \"multiply\" in the server-side \"TestAction\" Class:

\n\n\n
TestAction.multiply(\n    2, 4, // pass two arguments to server, so specify len=2\n    // callback function after the server is called\n    // result: the result returned by the server\n    //      e: Ext.Direct.RemotingEvent object\n    function(result, e){\n        var t = e.getTransaction();\n        var action = t.action; // server side Class called\n        var method = t.method; // server side method called\n        if(e.status){\n            var answer = Ext.encode(result); // 8\n    \n        }else{\n            var msg = e.message; // failure message\n        }\n    }\n);\n
\n\n\n

In the example above, the server side \"multiply\" function will be passed two\narguments (2 and 4). The \"multiply\" method should return the value 8 which will be\navailable as the result in the example above.

\n
Ext.direct.RemotingProvider
view source
: Number/Boolean
true or false to enable or disable combining of method\ncalls. ...

true or false to enable or disable combining of method\ncalls. If a number is specified this is the amount of time in milliseconds\nto wait before sending a batched request (defaults to 10).

\n\n\n

Calls which are received within the specified timeframe will be\n\n\n

concatenated together and sent in a single request, optimizing the\napplication by reducing the amount of round trips that have to be made\nto the server.

\n

Defaults to: 10

Ext.direct.RemotingProvider
view source
: String
Specify which param will hold the arguments for the method. ...

Specify which param will hold the arguments for the method.\nDefaults to 'data'.

\n
The unique id of the provider (defaults to an auto-assigned id). ...

The unique id of the provider (defaults to an auto-assigned id).\nYou should assign an id if you need to be able to access the provider later and you do\nnot have an object reference available, for example:

\n\n
Ext.Direct.addProvider(\n    {\n        type: 'polling',\n        url:  'php/poll.php',\n        id:   'poll-provider'\n    }\n);\n     \nvar p = Ext.Direct.getProvider('poll-provider');\np.disconnect();\n
\n\n
(optional) A config object containing one or more event handlers to be added to this\nobject during initialization. ...

(optional)

A config object containing one or more event handlers to be added to this\nobject during initialization. This should be a valid listeners config object as specified in the\naddListener example for attaching multiple handlers at once.

\n\n

DOM events from ExtJs Components

\n\n\n

While some ExtJs Component classes export selected DOM events (e.g. \"click\", \"mouseover\" etc), this\n\n\n

is usually only done when extra value can be added. For example the DataView's\nclick event passing the node clicked on. To access DOM\nevents directly from a Component's HTMLElement, listeners must be added to the Element after the Component\nhas been rendered. A plugin can simplify this step:

\n\n
// Plugin is configured with a listeners config object.\n// The Component is appended to the argument list of all handler functions.\nExt.DomObserver = Ext.extend(Object, {\n    constructor: function(config) {\n        this.listeners = config.listeners ? config.listeners : config;\n    },\n\n    // Component passes itself into plugin's init method\n    init: function(c) {\n        var p, l = this.listeners;\n        for (p in l) {\n            if (Ext.isFunction(l[p])) {\n                l[p] = this.createHandler(l[p], c);\n            } else {\n                l[p].fn = this.createHandler(l[p].fn, c);\n            }\n        }\n\n        // Add the listeners to the Element immediately following the render call\n        c.render = c.render.createSequence(function() {\n            var e = c.getEl();\n            if (e) {\n                e.on(l);\n            }\n        });\n    },\n\n    createHandler: function(fn, c) {\n        return function(e) {\n            fn.call(this, e, c);\n        };\n    }\n});\n\nvar combo = new Ext.form.ComboBox({\n\n    // Collapse combo when its element is clicked on\n    plugins: [ new Ext.DomObserver({\n        click: function(evt, comp) {\n            comp.collapse();\n        }\n    })],\n    store: myStore,\n    typeAhead: true,\n    mode: 'local',\n    triggerAction: 'all'\n});\n
\n\n\n

\n
Ext.direct.RemotingProvider
view source
: Number
Number of times to re-attempt delivery on failure of a call. ...

Number of times to re-attempt delivery on failure of a call. Defaults to 1.

\n

Defaults to: 1

Ext.direct.RemotingProvider
view source
: String/Object
Namespace for the Remoting Provider (defaults to the browser global scope of window). ...

Namespace for the Remoting Provider (defaults to the browser global scope of window).\nExplicitly specify the namespace Object, or specify a String to have a\nnamespace created implicitly.

\n
Priority of the request. ...

Priority of the request. Lower is higher priority, 0 means \"duplex\" (always on).\nAll Providers default to 1 except for PollingProvider which defaults to 3.

\n

Defaults to: 1

Ext.direct.RemotingProvider
view source
: Number
The timeout to use for each request. ...

The timeout to use for each request. Defaults to undefined.

\n
Required, undefined by default. ...

Required, undefined by default. The type of provider specified\nto Ext.Direct.addProvider to create a\nnew Provider. Acceptable values by default are:

\n
Ext.direct.RemotingProvider
view source
: String
Required. ...

Required. The url to connect to the Ext.Direct server-side router.

\n
Defined By

Methods

...
\n

Parameters

  • config : Object
    \n

Returns

Overrides: Ext.direct.Provider.constructor

Adds the specified events to the list of events which this Observable may fire. ...

Adds the specified events to the list of events which this Observable may fire.

\n

Parameters

  • o : Object|String

    Either an object with event names as properties with a value of true\nor the first event name string if multiple event names are being passed as separate parameters.

    \n
  • Optional : string

    . Event name if multiple event names are being passed as separate parameters.\nUsage:

    \n\n
    this.addEvents('storeloaded', 'storecleared');\n
    \n\n
( eventName, handler, [scope], [options] )
Appends an event handler to this object. ...

Appends an event handler to this object.

\n

Parameters

  • eventName : String

    The name of the event to listen for.

    \n
  • handler : Function

    The method the event invokes.

    \n
  • scope : Object (optional)

    The scope (this reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.

    \n
  • options : Object (optional)

    An object containing handler configuration.\nproperties. This may contain any of the following properties:

      \n
    • scope : Object
      The scope (this reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.
    • \n
    • delay : Number
      The number of milliseconds to delay the invocation of the handler after the event fires.
    • \n
    • single : Boolean
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • \n
    • buffer : Number
      Causes the handler to be scheduled to run in an Ext.util.DelayedTask delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is not invoked, but the new handler is scheduled in its place.
    • \n
    • target : Observable
      Only call the handler if the event was fired on the target Observable, not\nif the event was bubbled up from a child Observable.
    • \n

    \n\n

    \nCombining Options
    \nUsing the options argument, it is possible to combine different types of listeners:
    \n
    \nA delayed, one-time listener.\n

    myDataView.on('click', this.onClick, this, {\nsingle: true,\ndelay: 100\n});
    \n

    \nAttaching multiple handlers in 1 call
    \nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n

    \n

    myGridPanel.on({\n'click' : {\n    fn: this.onClick,\n    scope: this,\n    delay: 100\n},\n'mouseover' : {\n    fn: this.onMouseOver,\n    scope: this\n},\n'mouseout' : {\n    fn: this.onMouseOut,\n    scope: this\n}\n});
    \n

    \nOr a shorthand syntax:
    \n

    myGridPanel.on({\n'click' : this.onClick,\n'mouseover' : this.onMouseOver,\n'mouseout' : this.onMouseOut,\n scope: this\n});
    \n\n

Ext.direct.RemotingProvider
view source
( )private
...
\n
Ext.direct.RemotingProvider
view source
( )
Abstract methods for subclasses to implement. ...

Abstract methods for subclasses to implement.

\n

Overrides: Ext.direct.Provider.connect

Ext.direct.RemotingProvider
view source
( c, m )private
...
\n

Parameters

  • c : Object
    \n
  • m : Object
    \n
Ext.direct.RemotingProvider
view source
( )
Abstract methods for subclasses to implement. ...

Abstract methods for subclasses to implement.

\n

Overrides: Ext.direct.Provider.disconnect

Ext.direct.RemotingProvider
view source
( c, m, args )private
...
\n

Parameters

  • c : Object
    \n
  • m : Object
    \n
  • args : Object
    \n
Ext.direct.RemotingProvider
view source
( t, e )private
...
\n

Parameters

  • t : Object
    \n
  • e : Object
    \n
Ext.direct.RemotingProvider
view source
( c, m, form, callback, scope )private
...
\n

Parameters

  • c : Object
    \n
  • m : Object
    \n
  • form : Object
    \n
  • callback : Object
    \n
  • scope : Object
    \n
Ext.direct.RemotingProvider
view source
( data )private
...
\n

Parameters

  • data : Object
    \n
Enables events fired by this Observable to bubble up an owner hierarchy by calling\nthis.getBubbleTarget() if present. ...

Enables events fired by this Observable to bubble up an owner hierarchy by calling\nthis.getBubbleTarget() if present. There is no implementation in the Observable base class.

\n\n\n

This is commonly used by Ext.Components to bubble events to owner Containers. See Ext.Component.getBubbleTarget. The default\nimplementation in Ext.Component returns the Component's immediate owner. But if a known target is required, this can be overridden to\naccess the required target more quickly.

\n\n\n

Example:

\n\n\n
Ext.override(Ext.form.Field, {\n    //  Add functionality to Field's initComponent to enable the change event to bubble\n    initComponent : Ext.form.Field.prototype.initComponent.createSequence(function() {\n        this.enableBubble('change');\n    }),\n\n    //  We know that we want Field's events to bubble directly to the FormPanel.\n    getBubbleTarget : function() {\n        if (!this.formPanel) {\n            this.formPanel = this.findParentByType('form');\n        }\n        return this.formPanel;\n    }\n});\n\nvar myForm = new Ext.formPanel({\n    title: 'User Details',\n    items: [{\n        ...\n    }],\n    listeners: {\n        change: function() {\n            // Title goes red if form has been modified.\n            myForm.header.setStyle('color', 'red');\n        }\n    }\n});\n
\n\n

Parameters

  • events : String/Array

    The event name to bubble, or an Array of event names.

    \n
( eventName, args ) : Boolean
Fires the specified event with the passed parameters (minus the event name). ...

Fires the specified event with the passed parameters (minus the event name).

\n\n\n

An event may be set to bubble up an Observable parent hierarchy (See Ext.Component.getBubbleTarget)\nby calling enableBubble.

\n\n

Parameters

  • eventName : String

    The name of the event to fire.

    \n
  • args : Object...

    Variable number of parameters are passed to handlers.

    \n

Returns

  • Boolean

    returns false if any of the handlers return false otherwise it returns true.

    \n
Ext.direct.RemotingProvider
view source
( t )private
...
\n

Parameters

  • t : Object
    \n
...
\n

Parameters

  • xhr : Object
    \n
Ext.direct.RemotingProvider
view source
( opt )private
...
\n

Parameters

  • opt : Object
    \n
Checks to see if this object has any listeners for a specified event ...

Checks to see if this object has any listeners for a specified event

\n

Parameters

  • eventName : String

    The name of the event to check for

    \n

Returns

  • Boolean

    True if the event is being listened for, else false

    \n
Ext.direct.RemotingProvider
view source
( )private
private ...

private

\n
Ext.direct.RemotingProvider
view source
( )
inherited\n\nReturns whether or not the server-side is currently connected. ...

inherited

\n\n

Returns whether or not the server-side is currently connected.\nAbstract method for subclasses to implement.

\n

Overrides: Ext.direct.Provider.isConnected

( eventName, handler, [scope], [options] )
Appends an event handler to this object (shorthand for addListener.) ...

Appends an event handler to this object (shorthand for addListener.)

\n

Parameters

  • eventName : String

    The type of event to listen for

    \n
  • handler : Function

    The method the event invokes

    \n
  • scope : Object (optional)

    The scope (this reference) in which the handler function is executed.\nIf omitted, defaults to the object which fired the event.

    \n
  • options : Object (optional)

    An object containing handler configuration.

    \n
Ext.direct.RemotingProvider
view source
( opt, success, xhr )private
...
\n

Parameters

  • opt : Object
    \n
  • success : Object
    \n
  • xhr : Object
    \n
...
\n

Parameters

  • xhr : Object
    \n
Ext.direct.RemotingProvider
view source
( t )private
...
\n

Parameters

  • t : Object
    \n
Removes all listeners for this object ...

Removes all listeners for this object

\n
Ext.direct.RemotingProvider
view source
( t )private
...
\n

Parameters

  • t : Object
    \n
Relays selected events from the specified Observable as if the events were fired by this. ...

Relays selected events from the specified Observable as if the events were fired by this.

\n

Parameters

  • o : Object

    The Observable whose events this object is to relay.

    \n
  • events : Array

    Array of event names to relay.

    \n
( eventName, handler, [scope] )
Removes an event handler. ...

Removes an event handler.

\n

Parameters

  • eventName : String

    The type of event the handler was associated with.

    \n
  • handler : Function

    The handler to remove. This must be a reference to the function passed into the addListener call.

    \n
  • scope : Object (optional)

    The scope originally specified for the handler.

    \n
Resume firing events. ...

Resume firing events. (see suspendEvents)\nIf events were suspended using the queueSuspended parameter, then all\nevents fired during event suspension will be sent to any listeners now.

\n
Suspend the firing of all events. ...

Suspend the firing of all events. (see resumeEvents)

\n

Parameters

  • queueSuspended : Boolean

    Pass as true to queue up suspended events to be fired\nafter the resumeEvents call instead of discarding all suspended events;

    \n
( eventName, handler, [scope] )
Removes an event handler (shorthand for removeListener.) ...

Removes an event handler (shorthand for removeListener.)

\n

Parameters

  • eventName : String

    The type of event the handler was associated with.

    \n
  • handler : Function

    The handler to remove. This must be a reference to the function passed into the addListener call.

    \n
  • scope : Object (optional)

    The scope originally specified for the handler.

    \n
Defined By

Events

Ext.direct.RemotingProvider
view source
( provider, transaction, meta )
Fires immediately before the client-side sends off the RPC call. ...

Fires immediately before the client-side sends off the RPC call.\nBy returning false from an event handler you can prevent the call from\nexecuting.

\n

Parameters

Ext.direct.RemotingProvider
view source
( provider, transaction, meta )
Fires immediately after the request to the server-side is sent. ...

Fires immediately after the request to the server-side is sent. This does\nNOT fire after the response has come back from the call.

\n

Parameters

Fires when the Provider connects to the server-side ...

Fires when the Provider connects to the server-side

\n

Parameters

Fires when the Provider receives data from the server-side ...

Fires when the Provider receives data from the server-side

\n

Parameters

Fires when the Provider disconnects from the server-side ...

Fires when the Provider disconnects from the server-side

\n

Parameters

Fires when the Provider receives an exception from the server-side ...

Fires when the Provider receives an exception from the server-side

\n
","superclasses":["Ext.util.Observable","Ext.direct.Provider","Ext.direct.JsonProvider"],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"RemotingProvider.html#Ext-direct-RemotingProvider","filename":"RemotingProvider.js"}],"linenr":1,"members":{"property":[],"cfg":[{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"actions","id":"cfg-actions"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"enableBuffer","id":"cfg-enableBuffer"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"enableUrlEncode","id":"cfg-enableUrlEncode"},{"tagname":"cfg","owner":"Ext.direct.Provider","meta":{},"name":"id","id":"cfg-id"},{"tagname":"cfg","owner":"Ext.util.Observable","meta":{},"name":"listeners","id":"cfg-listeners"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"maxRetries","id":"cfg-maxRetries"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"namespace","id":"cfg-namespace"},{"tagname":"cfg","owner":"Ext.direct.Provider","meta":{},"name":"priority","id":"cfg-priority"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"timeout","id":"cfg-timeout"},{"tagname":"cfg","owner":"Ext.direct.Provider","meta":{},"name":"type","id":"cfg-type"},{"tagname":"cfg","owner":"Ext.direct.RemotingProvider","meta":{},"name":"url","id":"cfg-url"}],"css_var":[],"method":[{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"addEvents","id":"method-addEvents"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"addListener","id":"method-addListener"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"combineAndSend","id":"method-combineAndSend"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{},"name":"connect","id":"method-connect"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"createMethod","id":"method-createMethod"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{},"name":"disconnect","id":"method-disconnect"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"doCall","id":"method-doCall"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"doCallback","id":"method-doCallback"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"doForm","id":"method-doForm"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"doSend","id":"method-doSend"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"enableBubble","id":"method-enableBubble"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"fireEvent","id":"method-fireEvent"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"getCallData","id":"method-getCallData"},{"tagname":"method","owner":"Ext.direct.JsonProvider","meta":{"private":true},"name":"getEvents","id":"method-getEvents"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"getTransaction","id":"method-getTransaction"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"hasListener","id":"method-hasListener"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"initAPI","id":"method-initAPI"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{},"name":"isConnected","id":"method-isConnected"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"on","id":"method-on"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"onData","id":"method-onData"},{"tagname":"method","owner":"Ext.direct.JsonProvider","meta":{"private":true},"name":"parseResponse","id":"method-parseResponse"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"processForm","id":"method-processForm"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"purgeListeners","id":"method-purgeListeners"},{"tagname":"method","owner":"Ext.direct.RemotingProvider","meta":{"private":true},"name":"queueTransaction","id":"method-queueTransaction"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"relayEvents","id":"method-relayEvents"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"removeListener","id":"method-removeListener"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"resumeEvents","id":"method-resumeEvents"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"suspendEvents","id":"method-suspendEvents"},{"tagname":"method","owner":"Ext.util.Observable","meta":{},"name":"un","id":"method-un"}],"event":[{"tagname":"event","owner":"Ext.direct.RemotingProvider","meta":{},"name":"beforecall","id":"event-beforecall"},{"tagname":"event","owner":"Ext.direct.RemotingProvider","meta":{},"name":"call","id":"event-call"},{"tagname":"event","owner":"Ext.direct.Provider","meta":{},"name":"connect","id":"event-connect"},{"tagname":"event","owner":"Ext.direct.Provider","meta":{},"name":"data","id":"event-data"},{"tagname":"event","owner":"Ext.direct.Provider","meta":{},"name":"disconnect","id":"event-disconnect"},{"tagname":"event","owner":"Ext.direct.Provider","meta":{},"name":"exception","id":"event-exception"}],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.direct.RemotingProvider","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.direct.RemotingProvider","mixins":[],"mixedInto":[]});