Members
-
<static> isInited :boolean
-
Description
Flag indicating whether the Data Driven Configurator has been fully initialized. This is set to true after all dependent components have completed their initialization.
Details
Methods
-
<static> setConfiguration( configurationObject [, options ] )
-
Description
Sets the desired configuration. This method is very similar to configurator’s native setConfiguration, but it has several limitations, among them:
- It can only define a single attribute at a time using primitive or part reference.
- It cannot assign multiple attributes in one call.
- It cannot use metadata queries.
- The use of custom ID has not been tested.
Since 0.3.3, this method accepts an
options
object to define how the configuration should be set.Parameters
Name Type Attributes Default Description configurationObject
object A configuration object containing the attributes to set and their values
options
object <optional> Options as how the configuration should be set. Since 0.3.3
Name Type Attributes Default Description repercussionConfigPropagationMode
dataDrivenConfigurator.repercussionConfigPropagationMode <optional> async The way the repercussion configuration object should be propagated.
repercussionConfigDelayedPropagationModeDelay
dataDrivenConfigurator.repercussionConfigDelayedPropagationModeDelay <optional> 1 Delay in milliseconds to apply when repercussionConfigPropagationMode is set to
'delayed'
.Details
-
<static> forgetLastValueDefinedByUserForAttributes( attributes )
-
Description
Makes the data driven configurator forget about the values defined by the user and thus assign default values to the attributes rather than the ones previously defined.
Parameters
Name Type Default Description attributes
Array.<object> The list of attributes for which data driven should forget previous user defined values. If
null
, the values of all attributes will be forgotten.Details
-
<static> simulateSetConfiguration()
-
Description
This method is very similar to dataDrivenConfigurator.setConfiguration, but it does not set any configuration on the actual configurator:
- It does not propagate the desired configuration.
- It does not propagate any repercussion configuration.
Details
-
<static> unload()
-
Description
Unloads everything related to the data driven.
If used in addition to the player’s native unload, the data driven code’s one should be called first.Examples
window.dataDrivenConfigurator.unload(); player.unload();
Details
-
<static> getStatus() → {dataDrivenConfigurator.attributesStatus}
-
Description
Returns an object representing the status of the attributes and their values to be used to build and update a UI interacting with the configurator.
Returns
Details
Type Definitions
-
repercussionConfigPropagationMode
-
Description
An string defining how the repercussion configuration object should be propagated.
Possible values:
delayed
: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and then return immediately without waiting for the repercussionConfig that is sent immediately after via a setTimeout.async
: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and then return right after sending the repercussionConfig, without waiting for it to be done..sync
: data driven’s "setConfiguration" will await after the native "setConfiguration" is done and will also await the repercussionConfig to be done.
Details
-
repercussionConfigDelayedPropagationModeDelay
-
Description
An number defining the delay, in milliseconds, after which the repercussion configuration object should be propagated.
Taken into account only when dataDrivenConfigurator.repercussionConfigPropagationMode is set todelayed
.Details
-
attributesStatus
-
Description
An object representing the status of the attributes and their values, with other potential informations.
Properties
Name Type Attributes Description validAttributesAndTheirValues
Array.<object> The list of all valid attributes, in the right order, each of them having the list of all the available values, one of them being indicated as selected.
attributes
object Keys for the propagated attributes, as defined in the _dataDrivenConfigurator_propagatedAttributeSorting metadata (for descriptive data) or defered once _dataDrivenConfigurator_skuHeaders metatada is defined (for exhaustive data), otherwise, will be empty.
skus
object <optional> All valid skus for the current configuration. This object is fed with a pair of key/value for each column listed in the _dataDrivenConfigurator_skuHeaders metadata. If that metadata is not set at all, the skus object will not be present.
Details
Events
-
dataDrivenConfiguratorIsInited
-
Description
Fired when the Data Driven Configurator has inited.
Properties
Name Type Description detail
object A holder.
Name Type Description version
string The version of the Data Driven Configurator code that has been inited.
Details