Class type Ext_data_Model.statics


class type statics = object .. end
Inherits
method _COMMIT : Js.js_string Js.t Js.prop

The update operation of type 'commit'. Used by Store.update event.

Defaults to: 'commit'

method _EDIT : Js.js_string Js.t Js.prop

The update operation of type 'edit'. Used by Store.update event.

Defaults to: 'edit'

method _REJECT : Js.js_string Js.t Js.prop

The update operation of type 'reject'. Used by Store.update event.

Defaults to: 'reject'

method getFields : Ext_data_Field.t Js.js_array Js.t Js.meth

Returns an Array of Field definitions which define this Model's structure

Fields are sorted upon Model class definition. Fields with custom convert functions are moved to after fields with no convert functions. This is so that convert functions which rely on existing field values will be able to read those field values.

Returns:


method getProxy : 'a. 'a Js.t Js.meth

Returns the configured Proxy for this Model

Returns:


method id : 'b. 'b Js.t -> Js.js_string Js.t Js.meth

Generates a sequential id. This method is typically called when a record is created and no id has been specified either as a parameter, or through the idProperty in the passed data. The generated id will automatically be assigned to the record. The returned id takes the form: {PREFIX}-{AUTO_ID}.

Parameters:

Returns:


method load : 'c 'd. 'c Js.t -> 'd Js.t Js.optdef -> unit Js.meth

Asynchronously loads a model instance by id. Sample usage:

Ext.define('MyApp.User', {
    extend: 'Ext.data.Model',
    fields: [
        {name: 'id', type: 'int'},
        {name: 'name', type: 'string'}
    ]
});

MyApp.User.load(10, {
    scope: this,
    failure: function(record, operation) {
        //do something if the load failed
        //record is null
    },
    success: function(record, operation) {
        //do something if the load succeeded
    },
    callback: function(record, operation, success) {
        //do something whether the load succeeded or failed
        //if operation is unsuccessful, record is null
    }
});

Parameters:


method setFields : 'e 'f 'g. 'e Js.t -> 'f Js.t -> 'g Js.t -> unit Js.meth

Apply a new set of field and/or property definitions to the existing model. This will replace any existing fields, including fields inherited from superclasses. Mainly for reconfiguring the model based on changes in meta data (called from Reader's onMetaChange method).

Parameters:


method setProxy : 'h 'i. 'h Js.t -> 'i Js.t Js.meth

Sets the Proxy to use for this model. Accepts any options that can be accepted by Ext.createByAlias.

Parameters: