TheM.fdrs Reference
Constructor
The parent TheM class contains functionality enabling the initialization of any TheM subclass or submodule instance by simply calling TheM.doInit('subclassName'), where the input string is a case sensitive space-delimited string containing the names of all submodules that may be required in the current session. Most TheM subclasses also require the 'common' submodule. It is common to initialize the target submodule and any other submodule dependencies concurrently. The following example will initialize a new instance of the necessary submodules using a proxy constructor in TheM parent class.
Example
Properties
Property table for TheM.fdrs
Property | Description | Required | Schema |
---|---|---|---|
isReady | Gets (returns) true if TheM.fdrs is fully ready. | Yes | { "title": "TheM.fdrs.isReady", "type": "boolean", "description": "Gets (returns) true if TheM.fdrs is fully ready.", "$comment": "getter", "examples": [ true, false ], "default": false, "nullable": false } |
Methods
Method Name | Parameter Descriptions | Description | Example |
---|---|---|---|
doSave | [] |
Saves fdrs data in local storage. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. Returns true. | TheM.fdrs.doSave(); |
doLoad | [] |
Loads fdrs data from local storage and returns a boolean value to indicate success. Normally, there is no need to use this method as the framework knows automatically when to save and when to load the data to and from local storage. | TheM.fdrs.doLoad(); |
doUpdate | [ |
Causes framework to pull fresh fdrs data from the server. If the data is fresh enough, meaning an update has happened recently, the framework will ignore the suggestion. However, you can force the framework to update the data by sending true as an argument. On success, a(n) 'modelBank flexible data records refreshed' event will occur. |
TheM.fdrs.doUpdate(true); |
doPrepare | [ |
This method will create a new FDR instance. The FDR is referenced by the given name and the value may be of any type. Whatever is stored in the specified flexible data record is stored locally and synced with the server. There is a 500 ms wait before the server sync occurs in order to pool changes and avoid multiple calls when several FDRs are modified at once. Some FDRs received from the server are read-only and cannot be altered. FDRs can be used as persistent storage synchronized across all of the user's devices. | TheM.fdrs.doPrepare("fdr1",A flexible data record's value could be any type - a number, a string, a boolean, an array, an object, etc.); |
Submodules
Submodule Name | Link |
---|---|
FDR | FDR Reference |