3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.direct.Provider"></div>/**
\r
9 * @class Ext.direct.Provider
\r
10 * @extends Ext.util.Observable
\r
11 * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>
\r
13 * <p>For example ExtJs implements the following subclasses:</p>
\r
17 +---{@link Ext.direct.JsonProvider JsonProvider}
\r
19 +---{@link Ext.direct.PollingProvider PollingProvider}
\r
21 +---{@link Ext.direct.RemotingProvider RemotingProvider}
\r
25 Ext.direct.Provider = Ext.extend(Ext.util.Observable, {
\r
26 <div id="cfg-Ext.direct.Provider-id"></div>/**
\r
28 * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}).
\r
29 * You should assign an id if you need to be able to access the provider later and you do
\r
30 * not have an object reference available, for example:
\r
32 Ext.Direct.addProvider(
\r
35 url: 'php/poll.php',
\r
40 var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');
\r
45 <div id="cfg-Ext.direct.Provider-priority"></div>/**
\r
46 * @cfg {Number} priority
\r
47 * Priority of the request. Lower is higher priority, <tt>0</tt> means "duplex" (always on).
\r
48 * All Providers default to <tt>1</tt> except for PollingProvider which defaults to <tt>3</tt>.
\r
52 <div id="cfg-Ext.direct.Provider-type"></div>/**
\r
53 * @cfg {String} type
\r
54 * <b>Required</b>, <tt>undefined</tt> by default. The <tt>type</tt> of provider specified
\r
55 * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a
\r
56 * new Provider. Acceptable values by default are:<div class="mdetail-params"><ul>
\r
57 * <li><b><tt>polling</tt></b> : {@link Ext.direct.PollingProvider PollingProvider}</li>
\r
58 * <li><b><tt>remoting</tt></b> : {@link Ext.direct.RemotingProvider RemotingProvider}</li>
\r
63 constructor : function(config){
\r
64 Ext.apply(this, config);
\r
66 <div id="event-Ext.direct.Provider-connect"></div>/**
\r
68 * Fires when the Provider connects to the server-side
\r
69 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
72 <div id="event-Ext.direct.Provider-disconnect"></div>/**
\r
74 * Fires when the Provider disconnects from the server-side
\r
75 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
78 <div id="event-Ext.direct.Provider-data"></div>/**
\r
80 * Fires when the Provider receives data from the server-side
\r
81 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
82 * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.
\r
85 <div id="event-Ext.direct.Provider-exception"></div>/**
\r
87 * Fires when the Provider receives an exception from the server-side
\r
91 Ext.direct.Provider.superclass.constructor.call(this, config);
\r
94 <div id="method-Ext.direct.Provider-isConnected"></div>/**
\r
95 * Returns whether or not the server-side is currently connected.
\r
96 * Abstract method for subclasses to implement.
\r
98 isConnected: function(){
\r
102 <div id="prop-Ext.direct.Provider-connect"></div>/**
\r
103 * Abstract methods for subclasses to implement.
\r
105 connect: Ext.emptyFn,
\r
107 <div id="prop-Ext.direct.Provider-disconnect"></div>/**
\r
108 * Abstract methods for subclasses to implement.
\r
110 disconnect: Ext.emptyFn
\r