Using JSDOs to create mobile and web clients : JSDO overview : Properties of a JSDO
  

Properties of a JSDO

Every JSDO has several built-in properties and supports the creation of user-defined properties to manage its state. We have already introduced the following JSDO built-in properties:
*Table and field reference properties that provide access to table data loaded into JSDO memory and the record property, which provides access to individual record objects on a given table reference (see How JSDO memory works)
*The autoApplyChanges property on a JSDO, which indicates whether record change operations that complete with any kind of error cause the affected records to automatically revert to their values prior to the record change in JSDO memory (see General error handling for Data Object operations)
Four additional built-in properties are available for access on a JSDO:
*autoSort — A boolean property on a JSDO and its table references that indicates if record objects are sorted automatically at the completion of a supported JSDO operation that updates JSDO memory. In addition to setting this property to true (the default), in order to enable automatic sorting, you must invoke one or both of the setSortFields( ) and setSortFn( ) methods to specify how associated record objects are to be sorted—using specified sort fields or a user-defined sort function, respectively. You can set and reset this property at any time during the life of a JSDO to change what table references in JSDO memory are automatically sorted.
*caseSensitive — A boolean property on a JSDO and its table references that indicates if comparisons of string fields performed by supported JSDO operations on record objects in JSDO memory are case sensitive or case-insensitive for the affected table references. The setting of this property affects string comparisons only for merging record objects into JSDO memory using the addRecords( ) method and for the sorting of record objects in JSDO memory, including automatic sorting using the autoSort property and manual sorting using the sort( ) method. You can set and reset this property at any time during the life of a JSDO to change the case sensitivity of these supported string comparisons for selected table references in JSDO memory. However, note that any default string comparisons that you perform directly using JavaScript are case sensitive following JavaScript rules, regardless of the caseSensitive property setting.
*name — A string property that returns the name of the Data Object resource for which the JSDO is created. You must set this value either directly or indirectly using the progress.data.JSDO class constructor when you instantiate a JSDO. You can read the property on the JSDO after the JSDO is created.
*useRelationships — A boolean property that when set to true makes all data-relations active in JSDO memory so that searches on a child table reference involve only records related to its parent. In addition, record objects created in a child table have their key fields automatically set in relation to their parent. When set to false, searches on a child table reference involve all record objects stored in the JSDO table, regardless of data-relations, and any record objects created in a child table have no automatic settings for their key fields. You can set and reset this property at any time during the life of a JSDO to change the effect of data-relations on JSDO memory.
In addition to these JSDO built-in properties, you can set additional initialization properties in the class constructor, along with the JSDO name property itself. These initialization properties, which you cannot access after the JSDO is created, allow you to specify that certain JSDO methods are called during instantiation, including:
*Automatically calling the fill( ) method to initialize JSDO memory as the object is created
*Subscribing handler callbacks to JSDO events, especially to the beforeFill and afterFill (or the beforeRead and afterRead) events in order to handle the automatic execution of the fill( ) method
For more information on setting the JSDO name and initialization properties in the JSDO class constructor, see Creating and managing access to a JSDO instance.
Any JSDO also supports the creation of user-defined properties that you can use to store custom state information to help manage a given JSDO instance. You can create and access these user-defined properties using a set of JSDO built-in methods. Note that the JSDO reserves a subset of user-defined properties to support some of its behavior (currently, only the "server.count" user-defined property). For more information on working with user-defined properties see the descriptions of the following JSDO methods:
Note: Applies to Progress Data Objects Version 4.3 or later.
*setProperty( ) method
*setProperties( ) method
*getProperty( ) method
*getProperties( ) method