wiki:DeveloperGuidelines/EdenMobile/Settings

Version 10 (modified by Fran Boon, 4 years ago) ( diff )

--

Settings

table.settings (& consequently resource.settings) is a flexible JSON storage for configuration settings (equivalent to s3db.configure() on the Eden web application).

Here are some of the settings which are in-use:

Developer Settings

These are settings which a developer may see, but generally shouldn't need to touch

Setting Purpose Structure
autototals Allow a field to default to the sum of a set of other fields, whilst still allowing manual entry {"sumFieldname": ["sourceFieldname1", "sourceFieldname2"]}
grids Allow a set of fields to render as a Table in the form {"pseudoFieldname": {"r": ["rowLabel1", "rowLabel2"], "c": ["colLabel1", "colLabel2"], "f": [["realFieldname_forR1C1","realFieldname_forR1C2"],["realFieldname_forR2C1","realFieldname_forR2C2"]]}
subheadings Provide subheadings within CRUD create/update forms {"fieldname": "Heading"} or {"fieldname": ["Heading1", "Heading2"]}

NB

  • New settings need adding to validSettings in services/sync/schema_import.js.
  • For server-side dynamic models to export their table.settings to Mobile table.settings need to add to SERIALIZABLE_OPTS in s3model.py

Internal Settings

These are settings which a developer may see, but generally shouldn't need to touch

Setting Purpose Structure
main Whether this is a primary resource rather than a component or lookup table boolean
Note: See TracWiki for help on using the wiki.