3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.direct.Provider"></div>/**
\r
15 * @class Ext.direct.Provider
\r
16 * @extends Ext.util.Observable
\r
17 * <p>Ext.direct.Provider is an abstract class meant to be extended.</p>
\r
19 * <p>For example ExtJs implements the following subclasses:</p>
\r
23 +---{@link Ext.direct.JsonProvider JsonProvider}
\r
25 +---{@link Ext.direct.PollingProvider PollingProvider}
\r
27 +---{@link Ext.direct.RemotingProvider RemotingProvider}
\r
31 Ext.direct.Provider = Ext.extend(Ext.util.Observable, {
\r
32 <div id="cfg-Ext.direct.Provider-id"></div>/**
\r
34 * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}).
\r
35 * You should assign an id if you need to be able to access the provider later and you do
\r
36 * not have an object reference available, for example:
\r
38 Ext.Direct.addProvider(
\r
41 url: 'php/poll.php',
\r
46 var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');
\r
51 <div id="cfg-Ext.direct.Provider-priority"></div>/**
\r
52 * @cfg {Number} priority
\r
53 * Priority of the request. Lower is higher priority, <tt>0</tt> means "duplex" (always on).
\r
54 * All Providers default to <tt>1</tt> except for PollingProvider which defaults to <tt>3</tt>.
\r
58 <div id="cfg-Ext.direct.Provider-type"></div>/**
\r
59 * @cfg {String} type
\r
60 * <b>Required</b>, <tt>undefined</tt> by default. The <tt>type</tt> of provider specified
\r
61 * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a
\r
62 * new Provider. Acceptable values by default are:<div class="mdetail-params"><ul>
\r
63 * <li><b><tt>polling</tt></b> : {@link Ext.direct.PollingProvider PollingProvider}</li>
\r
64 * <li><b><tt>remoting</tt></b> : {@link Ext.direct.RemotingProvider RemotingProvider}</li>
\r
69 constructor : function(config){
\r
70 Ext.apply(this, config);
\r
72 <div id="event-Ext.direct.Provider-connect"></div>/**
\r
74 * Fires when the Provider connects to the server-side
\r
75 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
78 <div id="event-Ext.direct.Provider-disconnect"></div>/**
\r
80 * Fires when the Provider disconnects from the server-side
\r
81 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
84 <div id="event-Ext.direct.Provider-data"></div>/**
\r
86 * Fires when the Provider receives data from the server-side
\r
87 * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}.
\r
88 * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred.
\r
91 <div id="event-Ext.direct.Provider-exception"></div>/**
\r
93 * Fires when the Provider receives an exception from the server-side
\r
97 Ext.direct.Provider.superclass.constructor.call(this, config);
\r
100 <div id="method-Ext.direct.Provider-isConnected"></div>/**
\r
101 * Returns whether or not the server-side is currently connected.
\r
102 * Abstract method for subclasses to implement.
\r
104 isConnected: function(){
\r
108 <div id="prop-Ext.direct.Provider-connect"></div>/**
\r
109 * Abstract methods for subclasses to implement.
\r
111 connect: Ext.emptyFn,
\r
113 <div id="prop-Ext.direct.Provider-disconnect"></div>/**
\r
114 * Abstract methods for subclasses to implement.
\r
116 disconnect: Ext.emptyFn
\r