打印版式

Class Ext.data.Record

Package:Ext.data
Class:Record
Extends:Object
Defined In:Record.js
Instances of this class encapsulate both record definition information, and record value information for use in Ext.data.Store objects, or any code which needs to access Records cached in an Ext.data.Store object.

Constructors for this class are generated by passing an Array of field definition objects to create and instances are usually only created by Ext.data.Reader objects when processing unformatted data objects.

Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.


属性   -  方法   -  事件

公共属性

属性 定义对象
  dirty : Boolean Record
Readonly flag - true if this record has been modified.

公共方法

方法 定义对象
  Record(data {Array}, id (可选)) Record
This constructor should not be used to create Record objects. Instead, use the constructor generated by create. The p...
  commit() : void Record
Usually called by the Ext.data.Store which owns the Record. Commits all changes made to the Record since either creat...
  get(name {String}) : Object Record
Get the value of the named field.
  reject() : void Record
Usually called by the Ext.data.Store which owns the Record. Rejects all changes made to the Record since either creat...
  set(name {String}, value {Object}) : void Record
Set the named field to the specified value.

公共事件

此类没有公共事件。

属性详情

dirty

public Boolean dirty
Readonly flag - true if this record has been modified.
This property is defined by Record.

构造函数

Record

public function Record(data {Array}, id (可选))
This constructor should not be used to create Record objects. Instead, use the constructor generated by create. The parameters are the same.
参数:
  • {Array} : data
    An associative Array of data values keyed by the field name.
  • (可选) : id
    The id of the record. This id should be unique, and is used by the @link Ext.data.Store} object which owns the Record to index its collection of Records. If not specified an integer id is generated.

方法详情

commit

public function commit()
Usually called by the Ext.data.Store which owns the Record. Commits all changes made to the Record since either creation, or the last commit operation.

Developers should subscribe to the Ext.data.Store.update event to have their code notified of commit operations.

参数:
  • 无。
返回:
  • void
This method is defined by Record.

get

public function get(name {String})
Get the value of the named field.
参数:
  • {String} : name
    The name of the field to get the value of.
返回:
  • Object
    The value of the field.
This method is defined by Record.

reject

public function reject()
Usually called by the Ext.data.Store which owns the Record. Rejects all changes made to the Record since either creation, or the last commit operation. Modified fields are reverted to their original values.

Developers should subscribe to the Ext.data.Store.update event to have their code notified of reject operations.

参数:
  • 无。
返回:
  • void
This method is defined by Record.

set

public function set(name {String}, value {Object})
Set the named field to the specified value.
参数:
  • {String} : name
    The name of the field to set.
  • {Object} : value
    The value to set the field to.
返回:
  • void
This method is defined by Record.

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