|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gwtext.client.core.JsObject
com.gwtext.client.data.Record
public class Record
Instances of this class encapsulate both record definition information, and record value information for use in Store objects, or any code which needs to access Records cached in a Store object.
Store
Nested Class Summary | |
---|---|
static class |
Record.Operation
|
Field Summary | |
---|---|
static Record.Operation |
COMMIT
|
static Record.Operation |
EDIT
|
static Record.Operation |
REJECT
|
Fields inherited from class com.gwtext.client.core.JsObject |
---|
jsObj |
Constructor Summary | |
---|---|
Record(com.google.gwt.core.client.JavaScriptObject jsObj)
This constructor is for internal / special uses only. |
Method Summary | |
---|---|
void |
beginEdit()
Begin an edit. |
void |
cancelEdit()
Cancels all changes made in the current edit operation. |
void |
commit()
Usually called by the Store which owns the Record. |
void |
commit(boolean silent)
Usually called by the Store which owns the Record. |
Record |
copy()
Creates a copy of this record. |
Record |
copy(java.lang.String id)
Creates a copy of this record. |
void |
endEdit()
End an edit. |
boolean |
getAsBoolean(java.lang.String field)
Returns the Records value as a boolean value. |
java.util.Date |
getAsDate(java.lang.String field)
Return the fields value as a Date. |
double |
getAsDouble(java.lang.String field)
Returns the Records value as a double. |
float |
getAsFloat(java.lang.String field)
Returns the Records value as a float. |
int |
getAsInteger(java.lang.String field)
Returns the Records value as an integer. |
java.lang.Object |
getAsObject(java.lang.String field)
Return the field value as Object. |
java.lang.String |
getAsString(java.lang.String field)
Return the field value as String. |
com.google.gwt.core.client.JavaScriptObject |
getDataAsJsObject()
Returns the underlying native data representation like a Json or XML node. |
java.lang.Object |
getDataAsObject()
Returns the field value as an Object. |
java.lang.String[] |
getFields()
|
java.lang.String |
getId()
Returns the ID of the record or null if not defined. |
java.lang.String[] |
getModifiedFields()
Return the names of the fields that are modified in this record. |
boolean |
isDirty()
The Records modified state. |
boolean |
isEmpty(java.lang.String fieldName)
Return true if the specified field is null(or undefined) or an empty string |
boolean |
isModified(java.lang.String fieldName)
Return true if specified field has been modified. |
boolean |
isNull(java.lang.String fieldName)
Return true if specified field is null (or undefined) |
void |
reject()
Usually called by the Store which owns the Record. |
void |
reject(boolean silent)
Usually called by the Store which owns the Record. |
void |
set(java.lang.String field,
boolean value)
Sets the fields value. |
void |
set(java.lang.String field,
java.util.Date value)
Sets the fields value. |
void |
set(java.lang.String field,
double value)
Sets the fields value. |
void |
set(java.lang.String field,
float value)
Sets the fields value. |
void |
set(java.lang.String field,
int value)
Sets the fields value. |
void |
set(java.lang.String field,
java.lang.Object value)
Sets the fields Object value. |
void |
set(java.lang.String field,
java.lang.String value)
Sets the fields value. |
void |
setId(java.lang.String id)
Set the Record's ID. |
Methods inherited from class com.gwtext.client.core.JsObject |
---|
getJsObj, getProperties, isCreated, setJsObj |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Record.Operation EDIT
public static Record.Operation REJECT
public static Record.Operation COMMIT
Constructor Detail |
---|
public Record(com.google.gwt.core.client.JavaScriptObject jsObj)
RecordDef.createRecord(String, Object[])
to create
new Records.
jsObj
- a native record object.Method Detail |
---|
public java.lang.String getId()
public boolean isDirty()
public void beginEdit()
public void cancelEdit()
public Record copy()
public Record copy(java.lang.String id)
id
- a new record id if you don't want to use this record's id
public void commit()
StoreListener.onUpdate(Store, Record, com.gwtext.client.data.Record.Operation)
event
to have their code notified of commit operations.
public void commit(boolean silent)
StoreListener.onUpdate(Store, Record, com.gwtext.client.data.Record.Operation)
event
to have their code notified of commit operations.
silent
- true to skip notification of the owning store of the change (defaults to false)public void endEdit()
public java.lang.String getAsString(java.lang.String field)
field
- the field name
public java.lang.Object getAsObject(java.lang.String field)
field
- the field name
public boolean isModified(java.lang.String fieldName)
fieldName
- the field name
public boolean isNull(java.lang.String fieldName)
fieldName
- the field name
public boolean isEmpty(java.lang.String fieldName)
fieldName
- the field name
public void set(java.lang.String field, java.lang.Object value)
field
- the field namevalue
- the fiedl valuepublic void set(java.lang.String field, java.lang.String value)
field
- the field namevalue
- the field valuepublic int getAsInteger(java.lang.String field)
field
- the field name
public void set(java.lang.String field, int value)
field
- the field namevalue
- the field valuepublic float getAsFloat(java.lang.String field)
field
- the field name
public void set(java.lang.String field, float value)
field
- the field namevalue
- the field valuepublic double getAsDouble(java.lang.String field)
field
- the field name
public void set(java.lang.String field, double value)
field
- the field namevalue
- the field valuepublic boolean getAsBoolean(java.lang.String field)
field
- the field name
public void set(java.lang.String field, boolean value)
field
- the field namevalue
- the field valuepublic void setId(java.lang.String id)
id
- the record IDpublic java.util.Date getAsDate(java.lang.String field)
field
- the field name
public void set(java.lang.String field, java.util.Date value)
field
- the field namevalue
- the field valuepublic java.lang.String[] getModifiedFields()
public java.lang.String[] getFields()
public void reject()
StoreListener.onUpdate(Store, Record, com.gwtext.client.data.Record.Operation)
event
to have their code notified of reject operations.
public void reject(boolean silent)
StoreListener.onUpdate(Store, Record, com.gwtext.client.data.Record.Operation)
event
to have their code notified of reject operations.
silent
- true to skip notification of the owning store of the change (defaults to false)public java.lang.Object getDataAsObject()
public com.google.gwt.core.client.JavaScriptObject getDataAsJsObject()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |