Class type Ext_form_Basic.t


class type t = object .. end
Inherits
method owner : 'a. (#Ext_container_Container.t as 'a) Js.t Js.prop

The container component to which this BasicForm is attached.


method applyIfToFields : 'b.
'b Js.t ->
(< addEvents : 'e. 'e Js.t -> unit Js.meth;
addListener : 'f 'g 'h 'i 'j.
'f Js.t ->
'g Js.callback Js.optdef ->
'h Js.t Js.optdef ->
'i Js.t Js.optdef -> 'j Js.t Js.meth;
addManagedListener : 'k 'l 'm 'n 'o 'p.
'k Js.t ->
'l Js.t ->
'm Js.callback Js.optdef ->
'n Js.t Js.optdef ->
'o Js.t Js.optdef -> 'p Js.t Js.meth;
applyIfToFields : 'b. 'c;
applyToFields : 'q. 'q Js.t -> 'd Js.t Js.meth;
callParent : 'r 's. 'r Js.t -> 's Js.t Js.meth;
callSuper : 't 'u. 't Js.t -> 'u Js.t Js.meth;
checkDirty : unit Js.meth; checkValidity : unit Js.meth;
clearInvalid : 'd Js.t Js.meth; clearListeners : unit Js.meth;
clearManagedListeners : unit Js.meth; destroy : unit Js.meth;
doAction : 'v 'w. 'v Js.t -> 'w Js.t Js.optdef -> 'd Js.t Js.meth;
enableBubble : 'x. 'x Js.t -> unit Js.meth;
findField : 'y.
Js.js_string Js.t ->
(#Ext_form_field_Field.t as 'y) Js.t Js.meth;
fireEvent : 'z. Js.js_string Js.t -> 'z Js.t -> bool Js.t Js.meth;
fireEventArgs : 'a1.
Js.js_string Js.t ->
'a1 Js.t Js.js_array Js.t -> bool Js.t Js.meth;
getFieldValues : 'b1. bool Js.t Js.optdef -> 'b1 Js.t Js.meth;
getFields : Ext_util_MixedCollection.t Js.t Js.meth;
getInitialConfig : 'c1. Js.js_string Js.t Js.optdef -> 'c1 Js.t Js.meth;
getRecord : Ext_data_Model.t Js.t Js.meth;
getValues : 'd1.
bool Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> 'd1 Js.t Js.meth;
hasInvalidField : unit Js.meth;
hasListener : Js.js_string Js.t -> bool Js.t Js.meth;
hasListeners : 'e1. 'e1 Js.t Js.readonly_prop;
hasUpload : bool Js.t Js.meth;
initConfig : 'f1. 'f1 Js.t -> 'd Js.t Js.meth;
isDirty : bool Js.t Js.meth; isObservable : bool Js.t Js.prop;
isValid : bool Js.t Js.meth; load : 'g1. 'g1 Js.t -> 'd Js.t Js.meth;
loadRecord : Ext_data_Model.t Js.t -> 'd Js.t Js.meth;
markInvalid : 'h1. 'h1 Js.t -> 'd Js.t Js.meth;
mon : 'i1 'j1 'k1 'l1 'm1 'n1.
'i1 Js.t ->
'j1 Js.t ->
'k1 Js.callback Js.optdef ->
'l1 Js.t Js.optdef -> 'm1 Js.t Js.optdef -> 'n1 Js.t Js.meth;
mun : 'o1 'p1 'q1 'r1.
'o1 Js.t ->
'p1 Js.t ->
'q1 Js.callback Js.optdef -> 'r1 Js.t Js.optdef -> unit Js.meth;
on : 's1 't1 'u1 'v1 'w1.
's1 Js.t ->
't1 Js.callback Js.optdef ->
'u1 Js.t Js.optdef -> 'v1 Js.t Js.optdef -> 'w1 Js.t Js.meth;
owner : 'a. (#Ext_container_Container.t as 'a) Js.t Js.prop;
relayEvents : 'x1 'y1.
'x1 Js.t ->
Js.js_string Js.t Js.js_array Js.t ->
Js.js_string Js.t Js.optdef -> 'y1 Js.t Js.meth;
removeListener : 'z1 'a2.
Js.js_string Js.t ->
'z1 Js.callback -> 'a2 Js.t Js.optdef -> unit Js.meth;
removeManagedListener : 'b2 'c2 'd2 'e2.
'b2 Js.t ->
'c2 Js.t ->
'd2 Js.callback Js.optdef ->
'e2 Js.t Js.optdef -> unit Js.meth;
reset : bool Js.t Js.optdef -> 'd Js.t Js.meth;
resumeEvent : Js.js_string Js.t -> unit Js.meth;
resumeEvents : unit Js.meth; self : Ext_Class.t Js.t Js.prop;
setValues : 'f2. 'f2 Js.t -> 'd Js.t Js.meth;
statics : Ext_Class.t Js.t Js.meth;
submit : 'g2. 'g2 Js.t -> 'd Js.t Js.meth;
suspendEvent : Js.js_string Js.t -> unit Js.meth;
suspendEvents : bool Js.t -> unit Js.meth;
un : 'h2 'i2.
Js.js_string Js.t ->
'h2 Js.callback -> 'i2 Js.t Js.optdef -> unit Js.meth;
updateRecord : Ext_data_Model.t Js.t Js.optdef -> 'd Js.t Js.meth; .. >
as 'd)
Js.t Js.meth as 'c

Calls Ext.applyIf for all field in this form with the passed object.

Parameters:

Returns:


method applyToFields : 'q. 'q Js.t -> 'd Js.t Js.meth

Calls Ext.apply for all fields in this form with the passed object.

Parameters:

Returns:


method checkDirty : unit Js.meth

Check whether the dirty state of the entire form has changed since it was last checked, and if so fire the dirtychange event. This is automatically invoked when an individual field's dirty state changes.


method checkValidity : unit Js.meth

Check whether the validity of the entire form has changed since it was last checked, and if so fire the validitychange event. This is automatically invoked when an individual field's validity changes.


method clearInvalid : 'd Js.t Js.meth

Clears all invalid field messages in this form.

Returns:


method destroy : unit Js.meth

Destroys this object.


method doAction : 'v 'w. 'v Js.t -> 'w Js.t Js.optdef -> 'd Js.t Js.meth

Performs a predefined action (an implementation of Ext.form.action.Action) to perform application- specific processing.

Parameters:

Returns:


method findField : 'y. Js.js_string Js.t -> (#Ext_form_field_Field.t as 'y) Js.t Js.meth

Find a specific Ext.form.field.Field in this form by id or name.

Parameters:

Returns:


method getFieldValues : 'b1. bool Js.t Js.optdef -> 'b1 Js.t Js.meth

Retrieves the fields in the form as a set of key/value pairs, using their getModelData() method to collect the values. If multiple fields return values under the same name those values will be combined into an Array. This is similar to getValues except that this method collects type-specific data values (e.g. Date objects for date fields) while getValues returns only String values for submission.

Parameters:


method getFields : Ext_util_MixedCollection.t Js.t Js.meth

Return all the Ext.form.field.Field components in the owner container.

Returns:


method getRecord : Ext_data_Model.t Js.t Js.meth

Returns the last Ext.data.Model instance that was loaded via loadRecord

Returns:


method getValues : 'd1.
bool Js.t Js.optdef ->
bool Js.t Js.optdef ->
bool Js.t Js.optdef -> bool Js.t Js.optdef -> 'd1 Js.t Js.meth

Retrieves the fields in the form as a set of key/value pairs, using their getSubmitData() method to collect the values. If multiple fields return values under the same name those values will be combined into an Array. This is similar to getFieldValues except that this method collects only String values for submission, while getFieldValues collects type-specific data values (e.g. Date objects for date fields.)

Parameters:


method hasInvalidField : unit Js.meth

Returns true if the form contains any invalid fields. No fields will be marked as invalid as a result of calling this; to trigger marking of fields use isValid instead.


method hasUpload : bool Js.t Js.meth

Returns true if the form contains a file upload field. This is used to determine the method for submitting the form: File uploads are not performed using normal 'Ajax' techniques, that is they are not performed using XMLHttpRequests. Instead a hidden <form> element containing all the fields is created temporarily and submitted with its target set to refer to a dynamically generated, hidden <iframe> which is inserted into the document but removed after the return data has been gathered.

The server response is parsed by the browser to create the document for the IFRAME. If the server is using JSON to send the return object, then the Content-Type header must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

Characters which are significant to an HTML parser must be sent as HTML entities, so encode "<" as "&lt;", "&" as "&amp;" etc.

The response text is retrieved from the document, and a fake XMLHttpRequest object is created containing a responseText property in order to conform to the requirements of event handlers and callbacks.

Be aware that file upload packets are sent with the content type multipart/form and some server technologies (notably JEE) may require some custom processing in order to retrieve parameter names and parameter values from the packet content.


method isDirty : bool Js.t Js.meth

Returns true if any fields in this form have changed from their original values.

Note that if this BasicForm was configured with trackResetOnLoad then the Fields' original values are updated when the values are loaded by setValues or loadRecord.


method isValid : bool Js.t Js.meth

Returns true if client-side validation on the form is successful. Any invalid fields will be marked as invalid. If you only want to determine overall form validity without marking anything, use hasInvalidField instead.


method load : 'g1. 'g1 Js.t -> 'd Js.t Js.meth

Shortcut to do a load action.

Parameters:

Returns:


method loadRecord : Ext_data_Model.t Js.t -> 'd Js.t Js.meth

Loads an Ext.data.Model into this form by calling setValues with the record data. See also trackResetOnLoad.

Parameters:

Returns:


method markInvalid : 'h1. 'h1 Js.t -> 'd Js.t Js.meth

Mark fields in this form invalid in bulk.

Parameters:

Returns:


method reset : bool Js.t Js.optdef -> 'd Js.t Js.meth

Resets all fields in this form. By default, any record bound by loadRecord will be retained.

Parameters:

Returns:


method setValues : 'f2. 'f2 Js.t -> 'd Js.t Js.meth

Set values for fields in this form in bulk.

Parameters:

Returns:


method submit : 'g2. 'g2 Js.t -> 'd Js.t Js.meth

Shortcut to do a submit action. This will use the AJAX submit action by default. If the standardSubmit config is enabled it will use a standard form element to submit, or if the api config is present it will use the Ext.direct.Direct submit action.

The following code:

myFormPanel.getForm().submit({
    clientValidation: true,
    url: 'updateConsignment.php',
    params: {
        newStatus: 'delivered'
    },
    success: function(form, action) {
       Ext.Msg.alert('Success', action.result.msg);
    },
    failure: function(form, action) {
        switch (action.failureType) {
            case Ext.form.action.Action.CLIENT_INVALID:
                Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                break;
            case Ext.form.action.Action.CONNECT_FAILURE:
                Ext.Msg.alert('Failure', 'Ajax communication failed');
                break;
            case Ext.form.action.Action.SERVER_INVALID:
               Ext.Msg.alert('Failure', action.result.msg);
       }
    }
});

would process the following server response for a successful submission:

{
    "success":true, // note this is Boolean, not string
    "msg":"Consignment updated"
}

and the following server response for a failed submission:

{
    "success":false, // note this is Boolean, not string
    "msg":"You do not have permission to perform this operation"
}

Parameters:

Returns:


method updateRecord : Ext_data_Model.t Js.t Js.optdef -> 'd Js.t Js.meth

Persists the values in this form into the passed Ext.data.Model object in a beginEdit/endEdit block. If the record is not specified, it will attempt to update (if it exists) the record provided to loadRecord.

Parameters:

Returns: