class type t =Inheritsobject
..end
method dirty : bool Js.t Js.readonly_prop
True if this Record has been modified.
Defaults to: false
method editing : bool Js.t Js.readonly_prop
Internal flag used to track whether or not the model instance is currently being edited.
Defaults to: false
method fields : Ext_util_MixedCollection.t Js.t Js.prop
A Collection of the fields defined for this Model (including fields defined in superclasses)
This is a collection of Ext.data.Field instances, each of which encapsulates information that the field was configured with. By default, you can specify a field as simply a String, representing the name of the field, but a Field encapsulates data type, custom conversion of raw data, and a mapping property to specify by name of index, how to extract a field's value from a raw data object.
method isModel : bool Js.t Js.prop
true
in this class to identify an object as an instantiated Model, or subclass thereof.
Defaults to: true
method modified : 'a. 'a Js.t Js.prop
Key: value pairs of all fields whose values have changed
method phantom : bool Js.t Js.prop
True when the record does not yet exist in a server-side database (see setDirty). Any record which has a real database pk set as its id property is NOT a phantom -- it's real.
Defaults to: false
method raw : 'b. 'b Js.t Js.prop
The raw data used to create this model if created via a reader.
method store : 'c. 'c Js.t Js.prop
The Store to which this instance belongs. NOTE: If this instance is bound to multiple stores, this property will reference only the first. To examine all the stores, use the stores property instead.
method stores : 'd. 'd Js.js_array Js.t Js.prop
The Stores to which this instance is bound.
method beginEdit : unit Js.meth
Begins an edit. While in edit mode, no events (e.g.. the update
event) are relayed to the containing store.
When an edit has begun, it must be followed by either endEdit or cancelEdit.
method cancelEdit : unit Js.meth
Cancels all changes made in the current edit operation.
method commit : bool Js.t Js.optdef ->
Js.js_string Js.t Js.js_array Js.t Js.optdef -> unit Js.meth
Usually called by the Ext.data.Store which owns the model instance. Commits all changes made to the instance 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.
Parameters:
bool Js.t
(optional)
Pass true
to skip notification of the owning store of the change.
Defaults to: false
Js.js_string Js.t Js.js_array Js.t
(optional)
Array of field names changed during sync with server if known.
Omit or pass null
if unknown. An empty array means that it is known that no fields were modified
by the server's response.
Defaults to false.
method copy : Js.js_string Js.t Js.optdef ->
(< addEvents : 'g. 'g Js.t -> unit Js.meth;
addListener : 'h 'i 'j 'k 'l.
'h Js.t ->
'i Js.callback Js.optdef ->
'j Js.t Js.optdef -> 'k Js.t Js.optdef -> 'l Js.t Js.meth;
addManagedListener : 'm 'n 'o 'p 'q 'r.
'm Js.t ->
'n Js.t ->
'o Js.callback Js.optdef ->
'p Js.t Js.optdef ->
'q Js.t Js.optdef -> 'r Js.t Js.meth;
beginEdit : unit Js.meth; callParent : 's 't. 's Js.t -> 't Js.t Js.meth;
callSuper : 'u 'v. 'u Js.t -> 'v Js.t Js.meth; cancelEdit : unit Js.meth;
clearListeners : unit Js.meth; clearManagedListeners : unit Js.meth;
commit : bool Js.t Js.optdef ->
Js.js_string Js.t Js.js_array Js.t Js.optdef -> unit Js.meth;
copy : 'e; destroy : 'w. 'w Js.t -> 'f Js.t Js.meth;
dirty : bool Js.t Js.readonly_prop; editing : bool Js.t Js.readonly_prop;
enableBubble : 'x. 'x Js.t -> unit Js.meth;
endEdit : bool Js.t Js.optdef ->
Js.js_string Js.t Js.js_array Js.t Js.optdef -> unit Js.meth;
fields : Ext_util_MixedCollection.t Js.t Js.prop;
fireEvent : 'y. Js.js_string Js.t -> 'y Js.t -> bool Js.t Js.meth;
fireEventArgs : 'z.
Js.js_string Js.t ->
'z Js.t Js.js_array Js.t -> bool Js.t Js.meth;
get : 'a1. Js.js_string Js.t -> 'a1 Js.t Js.meth;
getAssociatedData : 'b1. 'b1 Js.t Js.meth;
getChanges : 'c1. 'c1 Js.t Js.meth;
getData : 'd1. bool Js.t -> 'd1 Js.t Js.meth;
getId : 'e1. 'e1 Js.t Js.meth;
getInitialConfig : 'f1. Js.js_string Js.t Js.optdef -> 'f1 Js.t Js.meth;
getProxy : 'g1. 'g1 Js.t Js.meth;
hasListener : Js.js_string Js.t -> bool Js.t Js.meth;
hasListeners : 'h1. 'h1 Js.t Js.readonly_prop;
initConfig : 'i1. 'i1 Js.t -> 'f Js.t Js.meth;
isModel : bool Js.t Js.prop;
isModified : Js.js_string Js.t -> bool Js.t Js.meth;
isObservable : bool Js.t Js.prop; isValid : bool Js.t Js.meth;
join : 'j1. 'j1 Js.t -> unit Js.meth; modified : 'a. 'a Js.t Js.prop;
mon : 'k1 'l1 'm1 'n1 'o1 'p1.
'k1 Js.t ->
'l1 Js.t ->
'm1 Js.callback Js.optdef ->
'n1 Js.t Js.optdef -> 'o1 Js.t Js.optdef -> 'p1 Js.t Js.meth;
mun : 'q1 'r1 's1 't1.
'q1 Js.t ->
'r1 Js.t ->
's1 Js.callback Js.optdef -> 't1 Js.t Js.optdef -> unit Js.meth;
on : 'u1 'v1 'w1 'x1 'y1.
'u1 Js.t ->
'v1 Js.callback Js.optdef ->
'w1 Js.t Js.optdef -> 'x1 Js.t Js.optdef -> 'y1 Js.t Js.meth;
phantom : bool Js.t Js.prop; raw : 'b. 'b Js.t Js.prop;
reject : bool Js.t Js.optdef -> unit Js.meth;
relayEvents : 'z1 'a2.
'z1 Js.t ->
Js.js_string Js.t Js.js_array Js.t ->
Js.js_string Js.t Js.optdef -> 'a2 Js.t Js.meth;
removeListener : 'b2 'c2.
Js.js_string Js.t ->
'b2 Js.callback -> 'c2 Js.t Js.optdef -> unit Js.meth;
removeManagedListener : 'd2 'e2 'f2 'g2.
'd2 Js.t ->
'e2 Js.t ->
'f2 Js.callback Js.optdef ->
'g2 Js.t Js.optdef -> unit Js.meth;
resumeEvent : Js.js_string Js.t -> unit Js.meth;
resumeEvents : unit Js.meth;
save : 'h2. 'h2 Js.t Js.optdef -> 'f Js.t Js.meth;
self : Ext_Class.t Js.t Js.prop;
set : 'i2 'j2.
'i2 Js.t -> 'j2 Js.t -> Js.js_string Js.t Js.js_array Js.t Js.meth;
setDirty : unit Js.meth; setId : 'k2. 'k2 Js.t -> unit Js.meth;
setProxy : 'l2 'm2. 'l2 Js.t -> 'm2 Js.t Js.meth;
statics : Ext_Class.t Js.t Js.meth; store : 'c. 'c Js.t Js.prop;
stores : 'd. 'd Js.js_array Js.t Js.prop;
suspendEvent : Js.js_string Js.t -> unit Js.meth;
suspendEvents : bool Js.t -> unit Js.meth;
un : 'n2 'o2.
Js.js_string Js.t ->
'n2 Js.callback -> 'o2 Js.t Js.optdef -> unit Js.meth;
unjoin : 'p2. 'p2 Js.t -> unit Js.meth;
validate : Ext_data_Errors.t Js.t Js.meth; .. >
as 'f)
Js.t Js.meth as 'e
Creates a copy (clone) of this Model instance.
Parameters:
Js.js_string Js.t
(optional)
A new id, defaults to the id of the instance being copied.
See id
. To generate a phantom instance with a new id use:
var rec = record.copy(); // clone the record
Ext.data.Model.id(rec); // automatically generate a unique sequential id
method destroy : 'w. 'w Js.t -> 'f Js.t Js.meth
Destroys the model using the configured proxy.
Parameters:
_ Js.t
Options to pass to the proxy. Config object for Ext.data.Operation.
Returns:
Ext_data_Model.t Js.t
The Model instance
method endEdit : bool Js.t Js.optdef ->
Js.js_string Js.t Js.js_array Js.t Js.optdef -> unit Js.meth
Ends an edit. If any data was modified, the containing store is notified
(ie, the store's update
event will fire).
Parameters:
bool Js.t
(optional)
True to not notify the store of the change
Js.js_string Js.t Js.js_array Js.t
(optional)
Array of field names changed during edit.
method get : 'a1. Js.js_string Js.t -> 'a1 Js.t Js.meth
Returns the value of the given field
Parameters:
Js.js_string Js.t
The field to fetch the value for
Returns:
_ Js.t
The value
method getAssociatedData : 'b1. 'b1 Js.t Js.meth
Gets all of the data from this Models loaded associations. It does this recursively - for example if we have a User which hasMany Orders, and each Order hasMany OrderItems, it will return an object like this:
{
orders: [
{
id: 123,
status: 'shipped',
orderItems: [
...
]
}
]
}
Returns:
_ Js.t
The nested data set for the Model's loaded associations
method getChanges : 'c1. 'c1 Js.t Js.meth
Gets a hash of only the fields that have been modified since this Model was created or commited.
method getData : 'd1. bool Js.t -> 'd1 Js.t Js.meth
Gets all values for each field in this model and returns an object containing the current data.
Parameters:
bool Js.t
True to also include associated data. Defaults to false.
Returns:
_ Js.t
An object hash containing all the values in this model
method getId : 'e1. 'e1 Js.t Js.meth
Returns the unique ID allocated to this model instance as defined by idProperty.
Returns:
_ Js.t
The id
method getProxy : 'g1. 'g1 Js.t Js.meth
Returns the configured Proxy for this Model.
Returns:
#Ext_data_proxy_Proxy.t Js.t
The proxy
method isModified : Js.js_string Js.t -> bool Js.t Js.meth
Returns true if the passed field name has been modified
since the load or last commit.
Parameters:
Js.js_string Js.t
method isValid : bool Js.t Js.meth
method join : 'j1. 'j1 Js.t -> unit Js.meth
Tells this model instance that it has been added to a store.
Parameters:
Ext_data_Store.t Js.t
The store to which this model has been added.
method reject : bool Js.t Js.optdef -> unit Js.meth
Usually called by the Ext.data.Store to which this model instance has been joined. Rejects all changes made to the model instance 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.
Parameters:
bool Js.t
(optional)
True to skip notification of the owning store of the change. Defaults to false.
method save : 'h2. 'h2 Js.t Js.optdef -> 'f Js.t Js.meth
Saves the model instance using the configured proxy.
Parameters:
_ Js.t
(optional)
Options to pass to the proxy. Config object for Ext.data.Operation.
Returns:
Ext_data_Model.t Js.t
The Model instance
method set : 'i2 'j2. 'i2 Js.t -> 'j2 Js.t -> Js.js_string Js.t Js.js_array Js.t Js.meth
Sets the given field to the given value, marks the instance as dirty
Parameters:
_ Js.t
The field to set, or an object containing key/value pairs
_ Js.t
The value to set
Returns:
Js.js_string Js.t Js.js_array Js.t
The array of modified field names or null if nothing was modified.
method setDirty : unit Js.meth
Marks this Record as dirty
. This method is used interally when adding phantom
records
to a writer enabled store.
Marking a record dirty
causes the phantom to be returned by Ext.data.Store.getUpdatedRecords
where it will have a create action composed for it during model save operations.
method setId : 'k2. 'k2 Js.t -> unit Js.meth
Sets the model instance's id field to the given id.
Parameters:
_ Js.t
The new id
method setProxy : 'l2 'm2. 'l2 Js.t -> 'm2 Js.t Js.meth
Sets the Proxy to use for this model. Accepts any options that can be accepted by Ext.createByAlias.
Parameters:
_ Js.t
The proxy
method unjoin : 'p2. 'p2 Js.t -> unit Js.meth
Tells this model instance that it has been removed from the store.
Parameters:
Ext_data_Store.t Js.t
The store from which this model has been removed.
method validate : Ext_data_Errors.t Js.t Js.meth
Validates the current data against all of its configured validations.
Returns:
Ext_data_Errors.t Js.t
The errors object