Class: DialogHelper

STX.Studies. DialogHelper


new DialogHelper()

Generates an object that can be used to create a dialog for creating or modifying a study. The object will then contain arrays for inputs, outputs and parameters. Each input will describe a form field that should be generated. Each output will describe a color swatch that should be generated. The results of the dialog would then be passed to STX.Studies.addStudy The libraryEntry, which is the object that defines the prototype for a study, may contain attributes which are used to help construct the input fields of the study dialog. See documentation of STX.Studies.studyLibrary.

Parameters:
Name Type Argument Description
params.name STX.Studies.StudyDescriptor

Name of study to add

params.sd STX.Studies.StudyDescriptor

A study descriptor when modifying an existing study

params.stx STX.STXChart

A chart object

params.inputs Object <optional>

Existing input parameters for the study (if modifying)

params.outputs Object <optional>

Existing output parameters for the study (if modifying)

params.parameters Object <optional>

Existing additional parameters for the study (if modifying)

Example
var helper=new STX.Studies.DialogHelper({sd:sd,stx:stx});
console.log(helper.inputs);
console.log(helper.outputs);
console.log(helper.parameters);

Methods


updateStudy(updates)

Update (or add) the study attached to the DialogHelper.

Parameters:
Name Type Description
updates Object

If updating, it should contain an object with updates to the inputs, outputs and patamters object used in STX.Studies.addStudy. A new study ID will be created using the default format or parameters.replaceID, if provided.

Example
var helper=new STX.Studies.DialogHelper({sd:sd, stx:stx});
helper.updateStudy({inputs:{Period:60}});