Name

Returns

Description

SK.Applications.Settings( env )

 

Constructor.

The "env" is the environment information that's passed by the framework upon every "init" of a code binding. 

This library makes sense to be executed only in administrator view because of security reasons.

set(
   settings,
   callback_ok,
   callback_failure
)

 

Sets a free-format "settings" (JSON format is preferred) for the current application. If the settings has been stored successfully the callback_ok is invoked. Otherwise is callback_failure is invoked.

The interface of the callback_ok function is
function( config ) { }
where "config" is the same as "settings".

The interface of the callback_failure is
function( message ) { }

get(
   callback_ok,
   callback_failure
)

 

Gets the current application settings. The callback_ok would receive the settings in the format it was set while the callback_failure receives a text message parameter.



 

Examples
Storing the application settings.

...
new SK.Applications.Settings(
   env
).set(
   {
      db_id: 1234,
      token: '1510a0f041lsas41npf01',
      columns: []
   },
   function( config ) {
      // We are all set
   },
   function( message ) {
      alert( "There was a failure storing the application settings: " + message );
   }
);
...