打印版式

Class Ext.data.Connection

Package:Ext.data
Class:Connection
Extends:Object
Defined In:Connection.js
The class encapsulates a connection to the page's originating domain, allowing requests to be made either to a configured URL, or to a URL specified at request time.

Requests made by this class are asynchronous, and will return immediately, and no data from the server will be available. To process the returned data, us a callback in the request options object.


属性   -  方法   -  事件   -  设置选项

公共属性

此类没有公共属性。

公共方法

方法 定义对象
  Connection(config {Object}) Connection
  abort() : void Connection
Aborts any outstanding request.
  isLoading() : Boolean Connection
Determine whether this object has a request outstanding.
  request([Object options.]) : void Connection
Sends an HTTP request to a remote server.

公共事件

此类没有公共事件。

设置选项

设置选项 定义对象
  {Number} : timeout Connection
(可选) The timeout in milliseconds to be used for requests. Defaults to 30000.

构造函数

Connection

public function Connection(config {Object})
参数:
  • {Object} : config
    a configuration object.

方法详情

abort

public function abort()
Aborts any outstanding request.
参数:
  • 无。
返回:
  • void
This method is defined by Connection.

isLoading

public function isLoading()
Determine whether this object has a request outstanding.
参数:
  • 无。
返回:
  • Boolean
    True if there is an outstanding request.
This method is defined by Connection.

request

public function request([Object options.])
Sends an HTTP request to a remote server.
参数:
  • options. : Object
    An object which may contain the following properties:
    • url {String} (可选) The URL to which to send the request. Defaults to configured URL
    • params {Object} (可选) An object containing properties which are used as extra parameters to the request
    • method {String} (可选) The HTTP method to use for the request. Defaults to the configured method, or if no method was configured, "GET" if no parameters are being sent, and "POST" if parameters are being sent.
    • callback {Function} (可选) The function to be called upon receipt of the HTTP response. The callback is passed the following parameters:
      • options {Object} The parameter to the request call.
      • success {Boolean} True if the request succeeded.
      • resopnse {Object} The XMLHttpRequest object containing the response data.
    • scope {Object} (可选) The scope in which to execute the callback: The "this" object for the callback function. Defaults to the browser window.
返回:
  • void
This method is defined by Connection.

设置详情

{Number}

{Number} : timeout
(可选) The timeout in milliseconds to be used for requests. Defaults to 30000.
This config option is defined by Connection.

Ext - Copyright © 2006-2007 Ext JS, LLC
All rights reserved.