Wiki source code of Dashboard API

Last modified by Aurelie Bertrand on 2026/07/13 14:55

Hide last authors
jhurst 1.1 1 {{ddtoc/}}
2
Aurelie Bertrand 55.1 3 ----
4
jhurst 1.1 5 (% class="wikigeneratedid" id="HFonctionsJavascript28DashboardAPI29" %)
Aurelie Bertrand 84.1 6 There are two ways to add customised behaviour to dashboards. The first is to use the global JavaScript editor available in the dashboard editor. The second is the Text Editor portlet. This element allows you to add a block of text (and/or HTML) to a dashboard page. The possibilities are expanded thanks to an application programming interface (API) that allows you to add JavaScript calls to dashboard functions to hyperlinks within a text editor.
jhurst 1.1 7
Aurelie Bertrand 84.1 8 Using these functions, you can trigger a page change, apply a filter to a given dimension, change a DigDash variable, and so on.
jhurst 1.1 9
Aurelie Bertrand 84.1 10 Each function is called on an implicit **ddCtrl** object defined by the dashboard engine. Here is the list of functions:
jhurst 1.1 11
12 (% class="box warningmessage" %)
13 (((
Aurelie Bertrand 84.1 14 //Unless otherwise stated, parameter values are object IDs, not formatted and/or translated names. For other parameters that are not IDs, their type is specified by a lower-case letter prefixed to their name: ‘b’ for Boolean, ‘o’ for object, ‘l’ for list (array) and ‘i’ for integer.//
jhurst 1.1 15
Aurelie Bertrand 84.1 16 //A parameter enclosed in square brackets [ ] is optional and may be omitted if it is not required in the context.//
jhurst 1.1 17 )))
18
Aurelie Bertrand 84.1 19 = Variable functions (DDVariables) =
jhurst 1.1 20
Aurelie Bertrand 58.1 21 (% class="wikigeneratedid" id="HvoidddCtrl.changeVariable28nom2Cvaleur29" %)
Aurelie Bertrand 84.1 22 **void ddCtrl.{{id name="changeVariable"/}} changeVariable(name, value)**
jhurst 1.1 23
Aurelie Bertrand 84.1 24 Description: Changes the value of the variable <name>.
jhurst 1.1 25
Aurelie Bertrand 84.1 26 Example:
jhurst 1.1 27
28 (% class="box" %)
29 (((
30 <a href="javascript:__ddCtrl.changeVariable__('ratioEuro', 1.30)">EuroDollar: 1.30</a>
31 )))
32
33
Aurelie Bertrand 84.1 34 **(Number) ddCtrl.getDDVar(name)**
jhurst 1.1 35
Aurelie Bertrand 84.1 36 Description: Returns the value of the variable <name>.
jhurst 1.1 37
Aurelie Bertrand 84.1 38 Example:
jhurst 1.1 39
40 (% class="box" %)
41 (((
Aurelie Bertrand 84.1 42 <a href="javascript:ddCtrl.changeVariable('ratioEuro', __ddCtrl.getDDVar__('ratioEuro') + 0.1)">Increase EuroDollar</a>
jhurst 1.1 43 )))
44
Aurelie Bertrand 84.1 45 = Data filtering and navigation functions =
jhurst 1.1 46
Aurelie Bertrand 84.1 47 **FilterOperand (dimension, member, hierarchy, level, formattedMember, bAddFilter, bExcludeFilter)**
jhurst 1.1 48
Aurelie Bertrand 84.1 49 Description: Object used to specify the filter to be applied.
jhurst 1.1 50
Aurelie Bertrand 84.1 51 Example:
jhurst 1.1 52
53 (% class="box" %)
54 (((
Aurelie Bertrand 84.1 55 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Geo Dim', new FilterOperand('Geo Dim', 'France', 'Geo', 'Country', false, false))">France filter</a>
jhurst 1.1 56 )))
57
58 (% class="box infomessage" %)
59 (((
Aurelie Bertrand 84.1 60 //Note: Setting the boolean bAjoutFiltre to true allows the filter to be added to the existing filter on this dimension. Setting the boolean bExcludeFilter to true enables the filter’s exclusion mode (rather than filtering on the member, this filters all other members except the one specified).//
jhurst 1.1 61 )))
62
63
Aurelie Bertrand 84.1 64 **FilterOperandContinuous (dimension, min, max, bExcludeFilter)**
jhurst 1.1 65
Aurelie Bertrand 84.1 66 Description: Object used to specify the interval filter to be applied to a continuous dimension.
jhurst 1.1 67
Aurelie Bertrand 84.1 68 Example:
jhurst 1.1 69
70 (% class="box" %)
71 (((
Aurelie Bertrand 84.1 72 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Country', new FilterOperandContinuous('Date', new Date(2018, 0, 1).getTime()/1000, new Date(2019, 0, 1).getTime()/1000, false))">Filter: Year 2018</a>
jhurst 1.1 73 )))
74
75 (% class="box infomessage" %)
76 (((
Aurelie Bertrand 84.1 77 //Note: Setting the boolean bExcluFiltre to true enables exclusion mode for the filter (rather than filtering on the specified member, it filters on all other members except the one specified).//
jhurst 1.1 78 )))
79
80
Aurelie Bertrand 84.1 81 **FilterOperandMatch (dimension, hierarchy, level, [values], [operators], mode, ExcludeFilter)**
crandon 9.1 82
Aurelie Bertrand 84.1 83 Description: Object used to specify a ‘Rule’ type filter to be applied to a continuous dimension.
crandon 9.1 84
Aurelie Bertrand 84.1 85 Example:
crandon 9.1 86
87 (% class="box" %)
88 (((
Aurelie Bertrand 84.1 89 <a href="javascript[[:>>path:javascript:ddCtrl.filter('Dim]]ddCtrl.filter('Geo Dim', new FilterOperandMatch('Geo Dim', 'Geographical', 'Country', ['A'], [13], 0, false))">Filter: Countries starting with A</a>
crandon 9.1 90 )))
91
92 (% class="box infomessage" %)
93 (((
Aurelie Bertrand 84.1 94 //Note~://
crandon 9.1 95
Aurelie Bertrand 84.1 96 //The ‘Operators’ table contains the filter type for each rule~://
crandon 9.1 97
Aurelie Bertrand 84.1 98 //0: not empty//
crandon 9.1 99
Aurelie Bertrand 84.1 100 //1: is empty//
crandon 9.1 101
Aurelie Bertrand 84.1 102 //2: is equal to//
crandon 9.1 103
Aurelie Bertrand 84.1 104 //3: contains//
crandon 9.1 105
Aurelie Bertrand 84.1 106 //4: does not contain//
crandon 9.1 107
Aurelie Bertrand 84.1 108 //5: is not equal to//
crandon 9.1 109
Aurelie Bertrand 84.1 110 //6: matches the regular expression//
crandon 9.1 111
Aurelie Bertrand 84.1 112 //7: contains the word//
crandon 9.1 113
Aurelie Bertrand 84.1 114 //8: does not contain the word//
crandon 9.1 115
Aurelie Bertrand 84.1 116 //9: is greater than//
crandon 9.1 117
Aurelie Bertrand 84.1 118 //10: is less than//
crandon 9.1 119
Aurelie Bertrand 84.1 120 //11: is greater than or equal to//
crandon 9.1 121
Aurelie Bertrand 84.1 122 //12: is less than or equal to//
crandon 9.1 123
Aurelie Bertrand 84.1 124 //13: starts with//
crandon 9.1 125
Aurelie Bertrand 84.1 126 //14: ends with//
crandon 9.1 127
Aurelie Bertrand 84.1 128 //15: is contained in//
crandon 9.1 129
Aurelie Bertrand 84.1 130 //16: is not contained in//
crandon 9.1 131
Aurelie Bertrand 84.1 132 //The values table contains the required values corresponding to the filter type.//
crandon 9.1 133 )))
134
135
Aurelie Bertrand 84.1 136 **void ddCtrl.filter (dimension, member)**
jhurst 1.1 137
Aurelie Bertrand 84.1 138 Description: filters by a dimension.
jhurst 1.1 139
Aurelie Bertrand 84.1 140 Example:
jhurst 1.1 141
142 (% class="box" %)
143 (((
Aurelie Bertrand 84.1 144 <a href="javascript:__ddCtrl.filter__('Pays', 'France')">Filter France</a>
jhurst 1.1 145 )))
146
147 (% class="box infomessage" %)
148 (((
Aurelie Bertrand 84.1 149 //Note: The specified member filters the hierarchy and the current level for this dimension.//
jhurst 1.1 150 )))
151
152
153 **void ddCtrl.filter (oFilterOperand)**
154
Aurelie Bertrand 84.1 155 Description: Filters on a dimension by specifying a hierarchy and a level.
jhurst 1.1 156
Aurelie Bertrand 84.1 157 Example:
jhurst 1.1 158
159 (% class="box" %)
160 (((
Aurelie Bertrand 84.1 161 <a href="**javascript:__ddCtrl.filter__(new FilterOperand(**'Lieu', 'FR', 'Géographique', 'Pays'))">France Details</a>
jhurst 1.1 162 )))
163
164 (% class="box infomessage" %)
165 (((
Aurelie Bertrand 84.1 166 //Note: Location// is the dimension, //FR// is the ID of the selected member, //Geographical// is the hierarchy and //Country// is the level.
jhurst 1.1 167 )))
168
169
crandon 5.1 170 **void ddCtrl.filterOnChart (portlet, oFilterOperand, doNotRefresh)**
171
Aurelie Bertrand 84.1 172 Description: Filters a chart by a dimension by specifying a hierarchy and a level.
crandon 5.1 173
Aurelie Bertrand 84.1 174 Example:
crandon 5.1 175
176 (% class="box" %)
177 (((
Aurelie Bertrand 84.1 178 <a href="**javascript:__ddCtrl.filterOnChart__(**'portletId1', new FilterOperand('Lieu', 'FR', 'Géographique', 'Pays'))">Details for France</a>
crandon 5.1 179 )))
180
181 (% class="box infomessage" %)
182 (((
Aurelie Bertrand 84.1 183 //Note: portletId1//is the chart ID, //Location// is the dimension, //FR// is the ID of the selected member, //Geographical// is the hierarchy and //Country// is the level.
crandon 5.1 184 )))
185
186
Aurelie Bertrand 84.1 187 **void ddCtrl.filterAndChangePage (page, dimension, member)**
jhurst 1.1 188
Aurelie Bertrand 84.1 189 Description: filters by a dimension and changes the page.
jhurst 1.1 190
Aurelie Bertrand 84.1 191 Example:
jhurst 1.1 192
193 (% class="box" %)
194 (((
Aurelie Bertrand 84.1 195 <a href="javascript:__ddCtrl.filterAndChangePage__('Production.Details Country', 'Country', 'France')">France Details</a>
jhurst 1.1 196 )))
197
198
Aurelie Bertrand 84.1 199 **void ddCtrl.changePageAndFilter (page, dimension, member)**
crandon 8.1 200
Aurelie Bertrand 84.1 201 Description: changes the page and filters by a dimension.
crandon 8.1 202
Aurelie Bertrand 84.1 203 Example:
crandon 8.1 204
205 (% class="box" %)
206 (((
Aurelie Bertrand 84.1 207 <a href="javascript:__ddCtrl.changePageAndFilter__('Production.Details Country', 'Country', 'France')">France Details</a>
crandon 8.1 208 )))
209
210
jhurst 1.1 211 **void ddCtrl.setFilterMinMax (dimension, min, max)**
212
Aurelie Bertrand 84.1 213 Description: Filters by a continuous dimension by specifying a minimum and maximum value. Note: A DigDash date is a timestamp in seconds.
jhurst 1.1 214
Aurelie Bertrand 84.1 215 Example:
jhurst 1.1 216
217 (% class="box" %)
218 (((
abertrand 11.1 219 <a href="javascript:__ddCtrl.setFilterMinMax__('Date', new Date(2014, 0, 1).getTime()/1000, new Date().getTime()/1000)">2014 to date</a>
jhurst 1.1 220 )))
221
222
Aurelie Bertrand 84.1 223 **(String Array) ddCtrl.getDimensionFilter (dimension [, bContinue])**
jhurst 1.1 224
Aurelie Bertrand 84.1 225 Description: Returns the list of elements filtered by the dimension (continuous or discrete).
jhurst 1.1 226
Aurelie Bertrand 84.1 227 Example:
jhurst 1.1 228
229 (% class="box" %)
230 (((
Aurelie Bertrand 84.1 231 <a href="javascript:alert(__ddCtrl.getDimensionFilter__('Pays'))">Filters by Country</a>
jhurst 1.1 232 )))
233
234
235 **void ddCtrl.isDimensionFiltered (dimension [, bContinue])**
236
Aurelie Bertrand 84.1 237 Description: Returns true if the dimension (continuous or discrete) is filtered. Returns false otherwise.
jhurst 1.1 238
Aurelie Bertrand 84.1 239 Example:
jhurst 1.1 240
241 (% class="box" %)
242 (((
Aurelie Bertrand 84.1 243 <a href="javascript:alert(__ddCtrl.isDimensionFiltered__('Pays'))">Is the country filtered?</a>
jhurst 1.1 244 )))
245
246
247 **void ddCtrl.removeAllFilters ()**
248
Aurelie Bertrand 84.1 249 Description: Removes all filters from the dashboard.
jhurst 1.1 250
Aurelie Bertrand 84.1 251 Example:
jhurst 1.1 252
253 (% class="box" %)
254 (((
255 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.removeAllFilters__(%%)()">Reset</a>
256 )))
257
258
259 **void ddCtrl.removeAllFiltersCurrentPage ()**
260
Aurelie Bertrand 84.1 261 Description: Removes the filters from the current page.
jhurst 1.1 262
Aurelie Bertrand 84.1 263 Example:
jhurst 1.1 264
265 (% class="box" %)
266 (((
Aurelie Bertrand 84.1 267 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)__removeAllFiltersCurrentPage__()">Reset</a>
jhurst 1.1 268 )))
269
270
271 **void ddCtrl.removeFilters (dimension [, bContinue])**
272
Aurelie Bertrand 84.1 273 Description: Removes the current filters on the dimension (continuous or discrete).
jhurst 1.1 274
275 (% class="box" %)
276 (((
Aurelie Bertrand 84.1 277 Example: <a href="javascript:__ddCtrl.removeFilters__('Pays')">All countries</a>
jhurst 1.1 278 )))
279
280
281 **void ddCtrl.beginSelection ()**
282
283 **void ddCtrl.commitSelection ()**
284
Aurelie Bertrand 84.1 285 Description: Used in conjunction with the ddCtrl.filter function. Allows multiple filters on different dimensions to be combined without having to run each filter individually (optimisation).
jhurst 1.1 286
Aurelie Bertrand 84.1 287 Example:
jhurst 1.1 288
289 (% class="box" %)
290 (((
Aurelie Bertrand 84.1 291 <a href="javascript:__ddCtrl.beginSelection__(); ddCtrl.filter('Country', 'France'); ddCtrl.filter('Year', '2013'); __ddCtrl.commitSelection__()">France in 2013</a>
jhurst 1.1 292 )))
293
294
Aurelie Bertrand 84.1 295 **void ddCtrl.setDimensionNavigation (dimension, {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bNavigation)**
jhurst 1.1 296
Aurelie Bertrand 84.1 297 Description: Changes the permission to navigate by a dimension for the specified flow.
jhurst 1.1 298
Aurelie Bertrand 84.1 299 Example:
jhurst 1.1 300
301 (% class="box" %)
302 (((
Aurelie Bertrand 84.1 303 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.setDimensionNavigation__(%%)('Region', 'chart1', true)">Enable navigation by Region</a>
jhurst 1.1 304 )))
305
306
Aurelie Bertrand 84.1 307 **(String array) ddCtrl.getCurrentDrill (portlet, dimension[, hierarchy])**
jhurst 1.1 308
Aurelie Bertrand 84.1 309 Description: Returns the dimension, hierarchy and current level of a chart as an array.
jhurst 1.1 310
311 (% class="box infomessage" %)
312 (((
Aurelie Bertrand 84.1 313 Note: This function can only be called on a chart with a “Navigate hierarchy” or “Change dimension” interaction.
jhurst 1.1 314 )))
315
Aurelie Bertrand 84.1 316 Example:
jhurst 1.1 317
cvaiana 7.1 318 {{code language="JAVASCRIPT" cssClass="notranslate"}}
jhurst 1.1 319 ddCtrl.addChartRefreshListener( function(doc, dm, dmsel, chart) {
320  if (chart.title == 'Mon graphique') {
321  var curDrill = ddCtrl.getCurrentDrill(doc.frameId, 'Région', 'Géographique');
322  var dim = curDrill[0];
323  var hier = curDrill[1];
324  var lvl = curDrill[2];
325  alert("L'exploration est " + hier + " / " +lvl + " sur la dimension " + dim);
326  }
327  });
328 {{/code}}
329
330
331 **(BreadPath) ddCtrl.getBreadPath (portlet, dimension)**
332
Aurelie Bertrand 84.1 333 Description: Returns the current navigation path (BreadPath) for a dimension in a chart. This object can be used by `drillTo` (see below).
jhurst 1.1 334
Aurelie Bertrand 84.1 335 Example:
jhurst 1.1 336
337 (% class="box" %)
338 (((
Aurelie Bertrand 84.1 339 <a href="javascript:__ddCtrl.drillTo__('portletId2', 'Lieu', __ddCtrl.getBreadPath__('portletId1', 'Location'))">Current Location Details (Chart 2)</a>
jhurst 1.1 340 )))
341
342
Aurelie Bertrand 62.1 343 **void ddCtrl.drillTo (portletId, dimension, oBreadPath)**
jhurst 1.1 344
Aurelie Bertrand 84.1 345 Description: Navigates within a chart along a hierarchy of the selected dimension, using a navigation path defined by the BreadPath object.
jhurst 1.1 346
Aurelie Bertrand 84.1 347 Example:
jhurst 1.1 348
349 (% class="box" %)
350 (((
Aurelie Bertrand 84.1 351 See example above (getBreadPath)
jhurst 1.1 352 )))
353
354
Aurelie Bertrand 84.1 355 **void ddCtrl.drillDown (portletId, dimension, hierarchy, level, member, formattedMember)**
jhurst 1.1 356
Aurelie Bertrand 84.1 357 Description: Navigates down a hierarchy of the selected dimension to the specified member at the lower level.
jhurst 1.1 358
359 (% class="box infomessage" %)
360 (((
Aurelie Bertrand 84.1 361 Note: The action is performed on all charts sharing the same navigation interaction (“synchronised drill-down”).
jhurst 1.1 362 )))
363
Aurelie Bertrand 84.1 364 Example:
jhurst 1.1 365
366 (% class="box" %)
367 (((
Aurelie Bertrand 84.1 368 <a href="javascript:__ddCtrl.drillTo__('portletId', 'Location', 'Geographic', 'FR', 'France')">France Details</a>0
jhurst 1.1 369 )))
370
371
Aurelie Bertrand 84.1 372 **void ddCtrl.resetDrill (portlet, dimension, [hierarchy])**
jhurst 1.1 373
Aurelie Bertrand 84.1 374 Description: Resets navigation on the dimension hierarchy.
jhurst 1.1 375
376 (% class="box infomessage" %)
377 (((
Aurelie Bertrand 84.1 378 Note: The action is performed on all charts sharing the same navigation interaction (“synchronised drill”).
jhurst 1.1 379 )))
380
Aurelie Bertrand 84.1 381 Example:
jhurst 1.1 382
383 (% class="box" %)
384 (((
Aurelie Bertrand 84.1 385 <a href="javascript:__ddCtrl.resetDrill__('portletId', 'Location')">Back to the world map</a>
jhurst 1.1 386 )))
387
388
Aurelie Bertrand 84.1 389 **void ddCtrl.selectMeasuresOnChart(portlet, [measures])**
crandon 6.1 390
Aurelie Bertrand 84.1 391 Description: Displays the specified measures on the chart; the other measures on the chart will be hidden.
crandon 6.1 392
Aurelie Bertrand 84.1 393 Example:
crandon 6.1 394
395 (% class="box" %)
396 (((
Aurelie Bertrand 84.1 397 <a href="javascript:__selectMeasuresOnChart__('portletId2', ['Turnover', 'Margins'])">Display Turnover and Margins</a>
crandon 6.1 398 )))
399
400
401
Aurelie Bertrand 84.1 402 **(Number | String) ddCtrl.getDataModelDate (dmId, bFormat)**
jhurst 1.1 403
Aurelie Bertrand 84.1 404 Description: Returns the synchronisation date of a data cube. The parameters are the data model ID and a Boolean value to format the date (true) or return the corresponding timestamp (false).
jhurst 1.1 405
406 (% class="box infomessage" %)
407 (((
Aurelie Bertrand 84.1 408 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
jhurst 1.1 409 )))
410
Aurelie Bertrand 84.1 411 Example:
jhurst 1.1 412
413 (% class="box" %)
414 (((
Aurelie Bertrand 84.1 415 <a href="javascript:alert(__ddCtrl.getDataModelDate__('a1234567890..', true))">Display the data date</a>
jhurst 1.1 416 )))
417
418
Aurelie Bertrand 84.1 419 **(Number | String) ddCtrl.getDataModelLinesCount (dmId)**
crandon 8.1 420
Aurelie Bertrand 84.1 421 Description: Returns the number of rows in a data cube. The parameter is the data model identifier.
crandon 8.1 422
Aurelie Bertrand 84.1 423 Example:
crandon 8.1 424
425 (% class="box" %)
426 (((
Aurelie Bertrand 84.1 427 <a href="javascript:alert(__ddCtrl.getDataModelLinesCount__('a1234567890..'))">Display the number of rows in the data</a>
crandon 8.1 428 )))
429
430
431
Aurelie Bertrand 84.1 432 **(Number | String) ddCtrl.getFlowDate ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bFormat)**
jhurst 1.1 433
Aurelie Bertrand 84.1 434 Description: Returns the synchronisation date of a flow. The parameters are the flow ID and a Boolean value to format the date (true) or return the corresponding timestamp (false).
jhurst 1.1 435
436 (% class="box infomessage" %)
437 (((
Aurelie Bertrand 84.1 438 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
jhurst 1.1 439 )))
440
Aurelie Bertrand 84.1 441 Example:
jhurst 1.1 442
443 (% class="box" %)
444 (((
Aurelie Bertrand 84.1 445 <A href="javascript:alert(__ddCtrl.getFlowDate__('fluxId', true))">Display the {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} date</A>
jhurst 1.1 446 )))
447
Aurelie Bertrand 84.1 448 = Data query functions =
jhurst 1.1 449
Aurelie Bertrand 84.1 450 **(Number | String) ddCtrl.getResultCubeValue ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, measure, lMembers, bFormatted)**
jhurst 1.1 451
Aurelie Bertrand 84.1 452 Description: Returns the value of the measure for the specified axis members from a visible chart. Returns the value as a number or as a formatted string.
jhurst 1.1 453
Aurelie Bertrand 84.1 454 Note: The list of axis members must specify //__one and only one member for each axis used__// in the chart, in the natural order of the chart’s axes. The measure parameter is the measure ID.
jhurst 1.1 455
Aurelie Bertrand 84.1 456 Example: To retrieve a value from a histogram defined as follows: Measure ‘Margin’ on the stack axis, dimension ‘Year’ on the column axis and ‘Country’ on the group axis:
jhurst 1.1 457
458 (% class="box" %)
459 (((
Aurelie Bertrand 84.1 460 <a href="javascript:alert(__ddCtrl.getResultCubeValue__('chart1', 'Margin', ['2023', 'France'], true))">Show the margin for France in 2023</a>
jhurst 1.1 461 )))
462
463 (% class="box warningmessage" %)
464 (((
Aurelie Bertrand 84.1 465 **Important: **It is important to ensure that the chart has loaded before calling this function. The simplest way is to include the call to this function within a listener passed to `addChartRefreshListener`
jhurst 1.1 466 )))
467
Aurelie Bertrand 84.1 468 **(Row table) ddCtrl.getResultCubeRowSet ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, oAxisMemberQuery [, bFormatted])**
jhurst 1.1 469
Aurelie Bertrand 84.1 470 Description: Returns the flattened rows of the result cube for the specified axis members from a visible chart. Returns the result as an array of rows, each row being an array of cells. The cells consist of the chart’s dimensions/axes followed by the measure values.
jhurst 1.1 471
472 (% class="box infomessage" %)
473 (((
Aurelie Bertrand 84.1 474 Note: The query for the axis members to be retrieved is a JavaScript object conforming to the following format (JSON): {"Axis/Dim title 1": "member 1", "Axis/Dim title 2": "member 2", etc.}..*
jhurst 1.1 475 )))
476
Aurelie Bertrand 84.1 477 Example: To retrieve the rows corresponding to the year 2024 and the person ‘John’ from a result cube of a chart named ‘chart1’:
jhurst 1.1 478
479 (% class="box" %)
480 (((
Aurelie Bertrand 84.1 481 <a href="javascript:alert(__ddCtrl.getResultCubeRowSet__('chart1', {'Year' : '2024', 'Person': 'John'})[0][2])">Show John’s first value in 2024</a>
jhurst 1.1 482 )))
483
484 (% class="box warningmessage" %)
485 (((
Aurelie Bertrand 84.1 486 **Important**: It is important to ensure that the chart is loaded before calling this function. The simplest way is to include the call to this function in a listener passed to `addChartRefreshListener`.
jhurst 1.1 487 )))
488
489
Aurelie Bertrand 84.1 490 **(Number) ddCtrl.getResultCubeLinesCount ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 491
Aurelie Bertrand 84.1 492 Description: Returns the number of flattened rows in the result cube.
jhurst 1.1 493
Aurelie Bertrand 84.1 494 Example:
jhurst 1.1 495
496 (% class="box" %)
497 (((
Aurelie Bertrand 84.1 498 <a href="javascript:alert((% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.getResultCubeLinesCount(__(%%)'chart1')" >Number of rows</a>
jhurst 1.1 499 )))
500
Aurelie Bertrand 23.1 501
abertrand 13.1 502 (% class="wikigeneratedid" %)
Aurelie Bertrand 84.1 503 **ddCtrl.getLastDimensionDate('data model ID', 'Time dimension')**
abertrand 13.1 504
505 (% class="wikigeneratedid" %)
Aurelie Bertrand 84.1 506 Description: Returns the maximum date of a time dimension as a timestamp.
abertrand 13.1 507
508 (% class="wikigeneratedid" %)
Aurelie Bertrand 84.1 509 Example:
abertrand 13.1 510
abertrand 14.1 511 (% class="box" %)
512 (((
Aurelie Bertrand 84.1 513 <a href="javascript:alert((% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)getLastDimensionDate(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__(__(%%)'a866caa04fabdd35687fa3bd3758d6a8', 'Date')" >Maximum date</a>
abertrand 14.1 514 )))
abertrand 13.1 515
Aurelie Bertrand 36.1 516
Aurelie Bertrand 84.1 517 **ddCtrl.getCubeValue ("data model ID", [filters], 'dimension or measure name', bUseContext)**
Aurelie Bertrand 36.1 518
Aurelie Bertrand 84.1 519 Description: Retrieves the value of a measure or the member of a dimension in a data model with the filters applied (so that only one row of data is returned by the server).
520 The UseContext parameter, which is a Boolean, allows you to specify whether or not the dashboard’s filtering context should be taken into account when calculating the data.
Aurelie Bertrand 37.1 521
Aurelie Bertrand 84.1 522 Example: To retrieve the value of the ‘Communication Cost’ measure with the filtered elements ‘Mobile’ for //Line Type// and ‘Samsung Galaxy’ for //Hardware, //in the data model with the identifier// " //0b2583609f86d37754ce2ada372f31ae", and taking into account the dashboard’s filter context:
Aurelie Bertrand 37.1 523
Aurelie Bertrand 38.1 524 (% class="box" %)
525 (((
Aurelie Bertrand 84.1 526 <a href="javascript:alert(ddCtrl.getCubeValue("0b2583609f86d37754ce2ada372f31ae", [{"dim":"Line type", "member":"Mobile"}, {"dim":"Hardware", "member":"Samsung Galaxy"}], 'Communication cost', true)">Communication cost value</a>
Aurelie Bertrand 38.1 527 )))
Aurelie Bertrand 36.1 528
Aurelie Bertrand 84.1 529 **ddCtrl.getFlowValue ("flow ID", [filters], 'dimension or measure name', bUseContext)**
Aurelie Bertrand 36.1 530
Aurelie Bertrand 84.1 531 Description: Retrieves the value of a measure or the member of a dimension in a {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} with the filters applied (so that only one row of data is returned by the server).
532 The UseContext parameter, which is a Boolean, allows you to specify whether or not to take the dashboard’s filtering context into account when calculating the data.
Aurelie Bertrand 38.1 533
Aurelie Bertrand 84.1 534 Example: To retrieve the member of the ‘Line Type’ dimension with the filtered element “Samsung Galaxy” for //Hardware, in //the flow with the identifier// “ //b312f6be”, and without taking the dashboard’s filter context into account:
Aurelie Bertrand 38.1 535
536 (% class="box" %)
537 (((
Aurelie Bertrand 84.1 538 <a href="javascript:alert(ddCtrl.getFlowValue("b312f6be", [{"dim":"Hardware", "member":"Samsung Galaxy"}], 'Line Type', false)>Line Type member</a>
Aurelie Bertrand 38.1 539 )))
540
Aurelie Bertrand 84.1 541 = Dashboard functions{{id name="Fonction_TDB"/}} =
jhurst 1.1 542
Aurelie Bertrand 35.1 543 (% class="box infomessage" %)
544 (((
Aurelie Bertrand 84.1 545 ℹ For functions involving PDF export, adding an HTML report or advanced formatting may cause rendering issues.
Aurelie Bertrand 35.1 546 )))
547
jhurst 1.1 548 **void ddCtrl.loadJS (urlJS)**
549
Aurelie Bertrand 84.1 550 Description: Loads a JavaScript file from a URL.
jhurst 1.1 551
Aurelie Bertrand 84.1 552 Example (in the JavaScript editor):
jhurst 1.1 553
cvaiana 7.1 554 {{code language="javascript" cssClass="notranslate"}}
jhurst 1.1 555 ddCtrl.loadJS('http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js');
556 var hash = CryptoJS.MD5("Le message");
557 {{/code}}
558
559
Aurelie Bertrand 84.1 560 **void ddCtrl.includeJS (JS_name)**
jhurst 1.1 561
Aurelie Bertrand 84.1 562 Description: Loads a JavaScript file from the DigDash Enterprise configuration folder. The file must have been created beforehand using the JavaScript editor in the dashboard editor.
jhurst 1.1 563
Aurelie Bertrand 84.1 564 Example (in the JavaScript editor):
jhurst 1.1 565
cvaiana 7.1 566 {{code language="javascript" cssClass="notranslate"}}
jhurst 1.1 567 ddCtrl.includeJS('fonctions_date.js');
568 {{/code}}
569
Aurelie Bertrand 32.1 570
571
Aurelie Bertrand 84.1 572 **void ddCtrl.drawFlowInElement ('HTML element or widget ID', '{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} ID');**
jhurst 1.1 573
Aurelie Bertrand 84.1 574 Description: Displays a flow within an HTML element
Aurelie Bertrand 31.1 575
Aurelie Bertrand 84.1 576 Example (in the JavaScript editor):
Aurelie Bertrand 31.1 577
Aurelie Bertrand 34.1 578 (% class="box" %)
579 (((
Aurelie Bertrand 84.1 580 <A href="javascript:ddCtrl.drawFlowInElement ('elementHTMLId', 'fluxId')">Display {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
Aurelie Bertrand 34.1 581 )))
Aurelie Bertrand 31.1 582
Aurelie Bertrand 46.1 583 (% class="box infomessage" %)
584 (((
Aurelie Bertrand 84.1 585 💡The ID is that of the portlet. You can copy it from the **Information** tab in **the element’s Settings **panel.
Aurelie Bertrand 47.1 586
Aurelie Bertrand 46.1 587 [[image:1747310722673-137.png]]
Aurelie Bertrand 84.1 588 \\For example: <A href="javascript:ddCtrl.drawFlowInElement ('Retail_Coûts_editor', '1898358537')">Display flow</A>
Aurelie Bertrand 46.1 589 )))
Aurelie Bertrand 31.1 590
Aurelie Bertrand 33.1 591
jhurst 1.1 592 **void ddCtrl.changePage (page)**
593
594 **void ddCtrl.switchPage (page)**
595
Aurelie Bertrand 84.1 596 Description: Changes the current page to <page>.
jhurst 1.1 597
Aurelie Bertrand 84.1 598 Example:
jhurst 1.1 599
600 (% class="box" %)
601 (((
Aurelie Bertrand 84.1 602 <a href="javascript:__ddCtrl.changePage__('Général.Index')">Back to index</a>
jhurst 1.1 603 )))
604
605
606 **void ddCtrl.nextPage ()**
607
Aurelie Bertrand 84.1 608 Description: Moves to the next page (same function).
jhurst 1.1 609
Aurelie Bertrand 84.1 610 Example:
jhurst 1.1 611
612 (% class="box" %)
613 (((
Aurelie Bertrand 84.1 614 <a href="javascript:__ddCtrl.nextPage__()">Next page</a>
jhurst 1.1 615 )))
616
617
618 **void ddCtrl.prevPage ()**
619
Aurelie Bertrand 84.1 620 Description: Moves to the previous page (same role).
jhurst 1.1 621
Aurelie Bertrand 84.1 622 Example:
jhurst 1.1 623
624 (% class="box" %)
625 (((
Aurelie Bertrand 84.1 626 <a href="javascript:__ddCtrl.prevPage__()">Previous page</a>
jhurst 1.1 627 )))
628
629
Aurelie Bertrand 84.1 630 **(Boolean) ddCtrl.isCurrentPage (page)**
jhurst 1.1 631
Aurelie Bertrand 84.1 632 Description: Returns true if the current page is the page with the ID specified as a parameter. Returns false otherwise.
jhurst 1.1 633
634 (% class="box infomessage" %)
635 (((
Aurelie Bertrand 84.1 636 Note: This function replaces the deprecated function __ddCtrl.getCurrentPage__ ()
jhurst 1.1 637 )))
638
639
Aurelie Bertrand 84.1 640 **(String) ddCtrl.getCurrentPage ()**
jhurst 1.1 641
Aurelie Bertrand 84.1 642 Description: Returns the name of the current page in the following format: <//Role name>.<Page name>//.
jhurst 1.1 643
644 (% class="box warningmessage" %)
645 (((
Aurelie Bertrand 84.1 646 **Deprecated**: This function has not been supported since November 2014 due to a change in the page name format. Please use the function __ddCtrl.isCurrentPage__ (page) instead.
jhurst 1.1 647 )))
648
649
Aurelie Bertrand 84.1 650 **(Boolean) ddCtrl.isPageLoaded(page)**
crandon 6.1 651
Aurelie Bertrand 84.1 652 Description: Returns true if the specified page has already been loaded. Returns false otherwise.
crandon 6.1 653
654
Aurelie Bertrand 84.1 655 **(Boolean) ddCtrl.isCurrentPageLoaded()**
Aurelie Bertrand 56.1 656
Aurelie Bertrand 84.1 657 Description: Returns true if the current page has already been loaded. Returns false otherwise.
Aurelie Bertrand 56.1 658
659
Aurelie Bertrand 84.1 660 **(Object) ddCtrl.getPage(page)**
crandon 6.1 661
Aurelie Bertrand 84.1 662 Description: Returns an object containing certain properties (ID, name, title, list of objects, etc.) of the specified page.
crandon 6.1 663
664
Aurelie Bertrand 84.1 665 **(Array) ddCtrl.getPagePath (page)**
crandon 6.1 666
Aurelie Bertrand 84.1 667 Description: Returns an array containing the page path (role / page group / page).
crandon 6.1 668
669
Aurelie Bertrand 84.1 670 **(Array) ddCtrl.dashboardPages**
crandon 6.1 671
Aurelie Bertrand 84.1 672 Description: An array containing all the pages for all roles of the logged-in user.
crandon 6.1 673
Aurelie Bertrand 84.1 674 Example:
crandon 6.1 675
Aurelie Bertrand 46.1 676 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
677 (((
Aurelie Bertrand 47.1 678 {{code language="shell"}}
679 ddCtrl.addCurrentPageLoadListener(function()
680 {
Aurelie Bertrand 21.1 681     console.log(ddCtrl.dashboardPages);
Aurelie Bertrand 47.1 682 });
683 {{/code}}
crandon 6.1 684
Aurelie Bertrand 84.1 685 (% style="background-color:rgba(220,220,220,0.5)" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]]
Aurelie Bertrand 46.1 686 )))
687
688
Aurelie Bertrand 84.1 689 **(Boolean) canChangeCurrentPage (page)**
jhurst 1.1 690
Aurelie Bertrand 84.1 691 Description: Returns true if it is possible to switch to the page <page>. Returns false otherwise.
jhurst 1.1 692
693
694 **void ddCtrl.hidePage (page)**
695
Aurelie Bertrand 84.1 696 Description: Hides the tab for page <page> if it is visible, without changing the current page.
jhurst 1.1 697
Aurelie Bertrand 84.1 698 Example:
jhurst 1.1 699
700 (% class="box" %)
701 (((
Aurelie Bertrand 84.1 702 <a href="javascript:__ddCtrl.hidePage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Global')">Exit details</a>
jhurst 1.1 703 )))
704
705
706 **void ddCtrl.showPage (page)**
707
Aurelie Bertrand 84.1 708 Description: Displays the tab for page <page> if it is hidden, without changing the current page.
jhurst 1.1 709
Aurelie Bertrand 84.1 710 Example:
jhurst 1.1 711
712 (% class="box" %)
713 (((
Aurelie Bertrand 84.1 714 <a href="javascript:__ddCtrl.showPage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Détails Pays')">Show details</a>
jhurst 1.1 715 )))
716
717
Aurelie Bertrand 84.1 718 **void ddCtrl.openFlowInWindow (flow, iWidth, iHeight)**
jhurst 1.1 719
Aurelie Bertrand 84.1 720 Description: Opens a flow in a pop-up window with the specified width and height.
jhurst 1.1 721
Aurelie Bertrand 84.1 722 Example:
jhurst 1.1 723
724 (% class="box" %)
725 (((
Aurelie Bertrand 84.1 726 <a href="javascript:__ddCtrl.openFlowInWindow__('fluxId', '250', '200')">Display product breakdown</a>
jhurst 1.1 727 )))
728
729
Aurelie Bertrand 84.1 730 **void ddCtrl.openPortletInWindow (portlet, iWidth, iHeight)**
jhurst 1.1 731
Aurelie Bertrand 84.1 732 Description: Opens a portlet in a pop-up window with the specified width and height.
jhurst 1.1 733
Aurelie Bertrand 84.1 734 Example:
abertrand 12.1 735
jhurst 1.1 736 (% class="box" %)
737 (((
Aurelie Bertrand 84.1 738 <a href="javascript:__ddCtrl.openPortletInWindow__('portletId', '250', '200')">Display product breakdown</a>
jhurst 1.1 739 )))
740
741
Aurelie Bertrand 84.1 742 **void ddCtrl.openFlowInWindowWithFilter (flow, iWidth, iHeight, dimension, member [, dimension, member, ...])**
jhurst 1.1 743
Aurelie Bertrand 84.1 744 Description: Opens a flow in a pop-up window with specified width and height, and filters it by the dimension(s) and member(s) specified as parameters (a list of dimension/member pairs).
jhurst 1.1 745
746 (% class="box infomessage" %)
747 (((
Aurelie Bertrand 84.1 748 Note: Filters will only be applied to the new window.
jhurst 1.1 749 )))
750
Aurelie Bertrand 84.1 751 Example:
jhurst 1.1 752
753 (% class="box" %)
754 (((
Aurelie Bertrand 84.1 755 <a href="javascript:__ddCtrl.openFlowInWindowWithFilter__('fluxId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
jhurst 1.1 756 )))
757
758
Aurelie Bertrand 84.1 759 **void ddCtrl.openPortletInWindowWithFilter (portlet, iWidth, iHeight, dimension, member [, dimension, member, ...])**
jhurst 1.1 760
Aurelie Bertrand 84.1 761 Description: Opens a portlet in a pop-up window with the specified width and height, and applies a filter based on the dimensions and members specified as parameters (a list of dimension/member pairs).
jhurst 1.1 762
763 (% class="box infomessage" %)
764 (((
Aurelie Bertrand 84.1 765 Note: Filters will only be applied to the new window.
jhurst 1.1 766 )))
767
Aurelie Bertrand 84.1 768 Example:
jhurst 1.1 769
770 (% class="box" %)
771 (((
Aurelie Bertrand 84.1 772 <a href="javascript:__ddCtrl.openPortletInWindowWithFilter__('portletId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
jhurst 1.1 773 )))
774
775
Aurelie Bertrand 84.1 776 **void ddCtrl.closeFlowInWindow (flow)**
abertrand 12.1 777
Aurelie Bertrand 84.1 778 Description: Allows you to programmatically close a pop-up displayed using the **openFlowInWindow**, **openPortletInWindow** and **openFormInWindow** functions.
abertrand 12.1 779
Aurelie Bertrand 84.1 780 This function takes as a parameter the identifier that was passed to the function used to display the pop-up.
abertrand 12.1 781
Aurelie Bertrand 84.1 782 Example:
abertrand 12.1 783
Aurelie Bertrand 46.1 784 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
785 (((
Aurelie Bertrand 47.1 786 {{code}}
787 ddCtrl.openFlowInWindow('716abf12', '80%', '80%');
abertrand 12.1 788
Aurelie Bertrand 47.1 789 ddCtrl.closeFlowInWindow('716abf12')
790 {{/code}}
abertrand 12.1 791
Aurelie Bertrand 84.1 792 (% style="background-color:rgba(220,220,220,0.5)" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]]
Aurelie Bertrand 46.1 793 )))
794
795
jhurst 1.1 796 **void ddCtrl.openDocument (serverName, fileName)**
797
Aurelie Bertrand 84.1 798 Description: Opens a document in a new window.
jhurst 1.1 799
Aurelie Bertrand 84.1 800 Example:
jhurst 1.1 801
802 (% class="box" %)
803 (((
Aurelie Bertrand 84.1 804 <a href="javascript:__ddCtrl.openDocument__('Common Datasources', 'catalogue_produits.pdf')">Display the product catalogue</a>
jhurst 1.1 805 )))
806
807
808 **void ddCtrl.uploadDocument (serverName, fileName)**
809
Aurelie Bertrand 84.1 810 Description: Uploads a document to a document server. Opens a file selection window on the workstation.
jhurst 1.1 811
Aurelie Bertrand 84.1 812 Example:
jhurst 1.1 813
814 (% class="box" %)
815 (((
Aurelie Bertrand 84.1 816 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.uploadDocument__(%%)('Common Datasources', 'catalogue_produits.pdf')">Upload the product catalogue</a>
jhurst 1.1 817 )))
818
819
Aurelie Bertrand 24.1 820 **void ddCtrl.deleteDocument (serverName, fileName)**
821
Aurelie Bertrand 84.1 822 Description: Deletes a document from the document server.
Aurelie Bertrand 24.1 823
Aurelie Bertrand 84.1 824 Example:
Aurelie Bertrand 24.1 825
826 (% class="box" %)
827 (((
Aurelie Bertrand 84.1 828 <a href="javascript:__ddCtrl.deleteDocument__('Common Datasources', 'catalogue_produits.pdf')">Delete the product catalogue</a>
Aurelie Bertrand 24.1 829 )))
830
831
832 **void ddCtrl.downloadDocument (serverName, fileName)**
833
Aurelie Bertrand 84.1 834 Description: Downloads a document from the document server.
Aurelie Bertrand 24.1 835
Aurelie Bertrand 84.1 836 Example:
Aurelie Bertrand 24.1 837
838 (% class="box" %)
839 (((
Aurelie Bertrand 84.1 840 <a href="javascript:__ddCtrl.downloadDocument__('Common Datasources', 'catalogue_produits.pdf')">Download the product catalogue</a>
Aurelie Bertrand 24.1 841 )))
842
843
844
jhurst 1.1 845 **void ddCtrl.refreshDashboard ()**
846
Aurelie Bertrand 84.1 847 Description: Refreshes the dashboard (same behaviour as the Refresh button in the dashboard header).
jhurst 1.1 848
Aurelie Bertrand 84.1 849 Example:
jhurst 1.1 850
851 (% class="box" %)
852 (((
Aurelie Bertrand 84.1 853 <a href="javascript:__ddCtrl.refreshDashboard__()">Refresh</a>
jhurst 1.1 854 )))
855
856
Aurelie Bertrand 84.1 857 **void ddCtrl.refreshFlow (flow, [event])**
jhurst 1.1 858
Aurelie Bertrand 84.1 859 Description: Refreshes the specified flow with an optional event name.
jhurst 1.1 860
Aurelie Bertrand 84.1 861 Example:
jhurst 1.1 862
863 (% class="box" %)
864 (((
Aurelie Bertrand 84.1 865 <A href="javascript:__ddCtrl.refreshFlow__('flowId', 'MAJ_QUOTIDIENNE')">Refresh {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
jhurst 1.1 866 )))
867
868
Aurelie Bertrand 84.1 869 **void ddCtrl.refreshFlows ([event])**
jhurst 1.1 870
Aurelie Bertrand 84.1 871 Description: Refreshes all flows on the dashboard with an optional event name.
jhurst 1.1 872
Aurelie Bertrand 84.1 873 Example:
jhurst 1.1 874
875 (% class="box" %)
876 (((
Aurelie Bertrand 84.1 877 <a href="javascript:__ddCtrl.refreshFlows__('MAJ_QUOTIDIENNE')"> Refresh all </a>
jhurst 1.1 878 )))
879
880
Aurelie Bertrand 84.1 881 **(String) ddCtrl.getCurrentRole ()**
jhurst 1.1 882
Aurelie Bertrand 84.1 883 Description: Returns the role ID of the current page or the user’s name for a user page.
jhurst 1.1 884
885
Aurelie Bertrand 84.1 886 **(String) ddCtrl.getRole(page)**
jhurst 1.1 887
Aurelie Bertrand 84.1 888 Description: Returns the role ID of the specified page (e.g. previously retrieved by __ddCtrl.getCurrentPage__()) or the user’s name if this page is a user page.
jhurst 1.1 889
890
891 **void ddCtrl.hidePortlet (portlet)**
892
893 **void ddCtrl.showPortlet (portlet)**
894
Aurelie Bertrand 43.1 895 (% class="box warningmessage" %)
896 (((
Aurelie Bertrand 84.1 897 ❗These functions must only be used on portlets present on the current page.
Aurelie Bertrand 43.1 898 )))
899
Aurelie Bertrand 84.1 900 Description: Hides or displays the specified chart portlet. The portlet parameter is an identifier that can be retrieved in the dashboard editor via the portlet’s ‘Information’ menu.
jhurst 1.1 901
Aurelie Bertrand 84.1 902 Example:
jhurst 1.1 903
904 (% class="box" %)
905 (((
Aurelie Bertrand 84.1 906 <a href="javascript:__ddCtrl.showPortlet__('portletId')">Show Details</a>
jhurst 1.1 907 )))
908
909
910 **void ddCtrl.setPortletPos (portlet, x, y)**
911
912 **void ddCtrl.setPortletSize (portlet, width, height)**
913
Aurelie Bertrand 84.1 914 Description: Positions or resizes the portlet to the specified coordinates or dimensions. The `portlet` parameter is an identifier that can be retrieved in the dashboard editor via the portlet’s ‘Information’ menu.
jhurst 1.1 915
Aurelie Bertrand 84.1 916 Example:
jhurst 1.1 917
918 (% class="box" %)
919 (((
Aurelie Bertrand 84.1 920 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '100', '100'); __ddCtrl.setPortletSize__('portletId', '600', '400')">Expand Details</a>
jhurst 1.1 921 )))
922
923
924 **void ddCtrl.setPortletMargins (portlet, marginTop, marginRight, marginBottom, marginLeft)**
925
Aurelie Bertrand 84.1 926 Description: Specifies the margins to be added to the portlet. The `portlet` parameter is an identifier that can be retrieved from the dashboard editor via the portlet’s Information menu.
jhurst 1.1 927
Aurelie Bertrand 84.1 928 Example:
jhurst 1.1 929
930 (% class="box" %)
931 (((
Aurelie Bertrand 84.1 932 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '10', '10', '10', '10'); __ddCtrl.setPortletMargins__('portletId', '600', '400')">Change the margins</a>
jhurst 1.1 933 )))
934
935
Aurelie Bertrand 84.1 936 **(Boolean) ddCtrl.chartIsHidden (portlet)**
jhurst 1.1 937
Aurelie Bertrand 84.1 938 Description: Returns true when the portlet is hidden (see hideChart) and false otherwise.
jhurst 1.1 939
940
Aurelie Bertrand 84.1 941 **void ddCtrl.genTemplatePPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 942
Aurelie Bertrand 84.1 943 Description: Runs a PowerPoint {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}} flow (saves the PPT) with the identifier flowId using the current selection from the dashboard. The user is offered the option to download the generated PPT.
jhurst 1.1 944
Aurelie Bertrand 84.1 945 Example:
jhurst 1.1 946
947 (% class="box" %)
948 (((
Aurelie Bertrand 84.1 949 <A href="javascript:__ddCtrl.genTemplatePPT__('Id Fabrique De Document')">Download PPT</A>
jhurst 1.1 950 )))
951
952
953 **void ddCtrl.exportCurrentPageAsPPT ()**
954
Aurelie Bertrand 84.1 955 Description: Saves the current dashboard page in PPT format. The user is offered the option to download the generated PPT.
Aurelie Bertrand 75.1 956
Aurelie Bertrand 84.1 957 Example:
jhurst 1.1 958
959 (% class="box" %)
960 (((
Aurelie Bertrand 84.1 961 <a href="javascript:__ddCtrl.exportCurrentPageAsPPT__()">Download this page as a PPT</a>
jhurst 1.1 962 )))
963
964
965 **void ddCtrl.exportPageAsPPT (role, page)**
966
Aurelie Bertrand 84.1 967 Description: Saves the page corresponding to the role and page ID specified as parameters. The user is prompted to download the generated PPT. The page ID can be retrieved in the dashboard editor (right-click on a page tab).
Aurelie Bertrand 75.1 968
Aurelie Bertrand 84.1 969 Example:
jhurst 1.1 970
971 (% class="box" %)
972 (((
Aurelie Bertrand 84.1 973 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.exportPageAsPPT__(%%)('Telecom', 'telecom_ventes_1')">Load the telecoms sales PPT</a>
jhurst 1.1 974 )))
975
976
Aurelie Bertrand 84.1 977 **void ddCtrl.genTemplatePDF(flow)**
jhurst 1.1 978
Aurelie Bertrand 84.1 979 Description: Runs a ‘PDF builder’ flow (saves the PDF) with the identifier flowId using the current selection from the dashboard. The user is prompted to download the generated PDF.
jhurst 1.1 980
Aurelie Bertrand 84.1 981 Example:
jhurst 1.1 982
983 (% class="box" %)
984 (((
Aurelie Bertrand 84.1 985 <A href="javascript:__ddCtrl.genTemplatePDF__('Id Fabrique De Document')">Download the PDF</A>
jhurst 1.1 986 )))
987
988
989 **void ddCtrl.exportCurrentPageAsPDF ()**
990
Aurelie Bertrand 84.1 991 Description: Saves the current dashboard page in PDF format. The user is offered the option to download the generated PDF.
Aurelie Bertrand 75.1 992
Aurelie Bertrand 84.1 993 Example:
jhurst 1.1 994
995 (% class="box" %)
996 (((
Aurelie Bertrand 84.1 997 <a href="javascript:__ddCtrl.exportCurrentPageAsPDF__()">Download this page as a PDF</a>
jhurst 1.1 998 )))
999
1000
1001 **void ddCtrl.exportPageAsPDF (role, page)**
1002
Aurelie Bertrand 84.1 1003 Description: Saves the page corresponding to the role and page ID specified as parameters. The user is offered the option to download the generated PDF. The page ID can be retrieved in the dashboard editor (right-click on a page tab).
Aurelie Bertrand 75.1 1004
Aurelie Bertrand 84.1 1005 Example:
jhurst 1.1 1006
1007 (% class="box" %)
1008 (((
Aurelie Bertrand 84.1 1009 <a href="javascript:(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)__ddCtrl.__(%%)__exportPageAsPDF__('Telecom', 'telecom_ventes_1')">Download the telecoms sales PDF</a>
jhurst 1.1 1010 )))
1011
1012
Aurelie Bertrand 84.1 1013 **void ddCtrl.genTemplateXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1014
Aurelie Bertrand 84.1 1015 Description: Runs an Excel {{glossaryReference glossaryId="Glossary" entryId="fabrique de documents"}}document builder{{/glossaryReference}} flow (saves the XLS file) with the identifier flowId using the current selection from the dashboard. The user is prompted to download the generated XLS file.
jhurst 1.1 1016
Aurelie Bertrand 84.1 1017 Example:
jhurst 1.1 1018
1019 (% class="box" %)
1020 (((
Aurelie Bertrand 84.1 1021 <A href="javascript:__ddCtrl.genTemplateXLS__('Id Fabrique De Document')">Download the XLS</A>
jhurst 1.1 1022 )))
1023
Aurelie Bertrand 84.1 1024 **void ddCtrl.genTemplateHTML ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1025
Aurelie Bertrand 84.1 1026 Description: Runs an {{glossaryReference glossaryId="Glossary" entryId="Fabrique HTML"}}HTML Builder{{/glossaryReference}} flow (saves the HTML) with the identifier flowId using the current selection from the dashboard. The user is offered the option to download the generated HTML.
Aurelie Bertrand 29.1 1027
Aurelie Bertrand 84.1 1028 Example:
Aurelie Bertrand 29.1 1029
1030 (% class="box" %)
1031 (((
Aurelie Bertrand 84.1 1032 <A href="javascript:__ddCtrl.genTemplateHTML__('Id Fabrique De Document')">Download the HTML</A>
Aurelie Bertrand 29.1 1033 )))
1034
Aurelie Bertrand 84.1 1035 **void ddCtrl.exportAsPDF ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1036
Aurelie Bertrand 84.1 1037 Description: Saves the flow as a PDF. The user is offered the option to download the generated PDF.
jhurst 1.1 1038
1039
Aurelie Bertrand 84.1 1040 **void ddCtrl.exportAsPPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1041
Aurelie Bertrand 84.1 1042 Description: Saves the flow as a PPT. The user is offered the option to download the generated PPT.
jhurst 1.1 1043
1044
Aurelie Bertrand 84.1 1045 **void ddCtrl.exportAsXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1046
Aurelie Bertrand 84.1 1047 Description: Saves the flow as an XLS file. The user is offered the option to download the generated XLS file.
jhurst 1.1 1048
1049
Aurelie Bertrand 84.1 1050 **void ddCtrl.exportAsXLSWithoutStyles ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1051
Aurelie Bertrand 84.1 1052 Description: Saves the flow as an XLS file without applying table styles to improve performance. The user is prompted to download the generated XLS file.
jhurst 1.1 1053
1054
Aurelie Bertrand 84.1 1055 **void ddCtrl.exportAsCSV ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1056
Aurelie Bertrand 84.1 1057 Description: Saves the flow as a CSV (Comma-Separated Values) file. The user is prompted to download the generated CSV file.
jhurst 1.1 1058
1059
Aurelie Bertrand 84.1 1060 **void ddCtrl.saveDashboardState (name, default)**
jhurst 1.1 1061
Aurelie Bertrand 84.1 1062 Description: Saves the current state of the dashboard (page, filters, drill-down, variables). This is identical to the action triggered by the ‘Save Selection’ button in the dashboard toolbar. The name parameter is the name of the selection; the bDefault parameter enables the selection to be loaded when the dashboard starts.
jhurst 1.1 1063
1064
Aurelie Bertrand 84.1 1065 **(String) ddCtrl.getCurrentPortletInGroupOfTabs (portletTabId)**
jhurst 1.1 1066
Aurelie Bertrand 84.1 1067 Description: Returns the ID of the current portlet in the Tab Group object. The `portletTabId` parameter is the ID of the Tab Group.
jhurst 1.1 1068
1069
1070 **void ddCtrl.changePortletInGroupOfTabs (portletTabId, portletId)**
1071
Aurelie Bertrand 84.1 1072 Description: Changes the current portlet of the Tab Group object. The `portletTabId` parameter is the identifier of the Tab Group; the `portletId` parameter is the identifier of the portlet to be selected.
jhurst 1.1 1073
1074
Aurelie Bertrand 84.1 1075 **(Array) ddCtrl.getCurrentPagePath ()**
jhurst 1.1 1076
Aurelie Bertrand 84.1 1077 Description: Returns the path of the current page (Role / Page / Subpage) as an array of objects. Each object has the following attributes: id, title, name, type (role/container/page).
jhurst 1.1 1078
Aurelie Bertrand 19.1 1079
Aurelie Bertrand 18.1 1080 **void ddCtrl.expandCollapseNavigationMenu()**
1081
Aurelie Bertrand 84.1 1082 Description: Collapses the navigation menu if it is expanded, and vice versa.
Aurelie Bertrand 18.1 1083
Aurelie Bertrand 66.1 1084
Aurelie Bertrand 84.1 1085 == Scale Mode Functions{{id name="scale"/}} ==
Aurelie Bertrand 66.1 1086
Aurelie Bertrand 84.1 1087 These functions relate to zoom selection in **Scale** or **Grid + Scale** mode.
Aurelie Bertrand 66.1 1088
Aurelie Bertrand 66.2 1089 **void ddCtrl.setScalingZoom(zoom)**
1090
Aurelie Bertrand 84.1 1091 Description: Sets the zoom level to the specified value.
Aurelie Bertrand 66.2 1092
Aurelie Bertrand 84.1 1093 Example:
Aurelie Bertrand 66.2 1094
1095 (% class="box" %)
1096 (((
Aurelie Bertrand 84.1 1097 <a href="javascript:__ddCtrl.setScalingZoom(0.65)__">Set the page zoom to 65%</a>
Aurelie Bertrand 66.2 1098 )))
1099
Aurelie Bertrand 69.1 1100
Aurelie Bertrand 66.2 1101 **void ddCtrl.setScalingAdaptWidth()**
1102
Aurelie Bertrand 84.1 1103 Description: applies the ‘Adapt to width’ zoom.
Aurelie Bertrand 66.2 1104
1105
Aurelie Bertrand 69.1 1106
Aurelie Bertrand 66.2 1107 **void ddCtrl.setScalingAdaptHeight()**
1108
Aurelie Bertrand 84.1 1109 Description: applies the ‘Adapt to height’ zoom.
Aurelie Bertrand 66.2 1110
1111
Aurelie Bertrand 69.1 1112
Aurelie Bertrand 66.2 1113 **void ddCtrl.setScalingZoomRange(min, max)**
1114
Aurelie Bertrand 84.1 1115 Description: sets the minimum and maximum zoom limits. The user will not be able to set a zoom level outside these values.
Aurelie Bertrand 66.2 1116
Aurelie Bertrand 84.1 1117 Example:
Aurelie Bertrand 66.2 1118
1119 (% class="box" %)
1120 (((
Aurelie Bertrand 84.1 1121 <a href="javascript:__setScalingZoomRange(0.4,1.2)__">Set a zoom range between 40 and 120%</a>
Aurelie Bertrand 66.2 1122 )))
1123
Aurelie Bertrand 84.1 1124 = Event handling =
jhurst 1.1 1125
Aurelie Bertrand 84.1 1126 These listener functions are called by the system when specific events are triggered. You can therefore create new behaviours depending on different situations: a chart is refreshed or drawn, a page is changed, a dimension is filtered, etc. The best place to implement these behaviours is in the global JavaScript editor, accessible via the options menu in the dashboard editor.
jhurst 1.1 1127
Aurelie Bertrand 84.1 1128 == Dashboard Events Diagram ==
jhurst 1.1 1129
Aurelie Bertrand 84.1 1130 (% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" tabindex="-1" %)[[image:api_event_diagram.gif||queryString="width=641&height=802"]](% title="Cliquer et glisser pour redimensionner" %)​(% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" style="background-color:rgba(220,220,220,0.5)" tabindex="-1" %)[[image:data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==||draggable="true" height="15" role="presentation" title="Cliquer et glisser pour déplacer" width="15"]](% aria-label="Élément api_event_diagram.gif image" contenteditable="false" role="region" tabindex="-1" title="Cliquer et glisser pour redimensionner" %)​
jhurst 1.1 1131
Aurelie Bertrand 84.1 1132 **void ddCtrl.addChartBeforeRefreshListener (Function)**
jhurst 1.1 1133
Aurelie Bertrand 84.1 1134 Description: Adds a listener function for the event triggered before the chart is refreshed.
jhurst 1.1 1135
Aurelie Bertrand 84.1 1136 Example:
jhurst 1.1 1137
1138 (% class="box" %)
1139 (((
Aurelie Bertrand 84.1 1140 ddCtrl.addChartBeforeRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be refreshed"); });
jhurst 1.1 1141 )))
1142
1143
Aurelie Bertrand 84.1 1144 **void ddCtrl.addChartRefreshListener (Function)**
jhurst 1.1 1145
Aurelie Bertrand 84.1 1146 Description: Adds a function to listen for the event triggered after the chart has been refreshed.
jhurst 1.1 1147
Aurelie Bertrand 84.1 1148 Example:
jhurst 1.1 1149
1150 (% class="box" %)
1151 (((
Aurelie Bertrand 84.1 1152 ddCtrl.addChartRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been refreshed"); });
jhurst 1.1 1153 )))
1154
1155
Aurelie Bertrand 84.1 1156 **void ddCtrl.addChartDrawnListener (Function)**
jhurst 1.1 1157
Aurelie Bertrand 84.1 1158 Description: Adds a function to listen for the event triggered when the chart has finished being drawn (first display).
jhurst 1.1 1159
Aurelie Bertrand 84.1 1160 Example:
jhurst 1.1 1161
1162 (% class="box" %)
1163 (((
Aurelie Bertrand 84.1 1164 ddCtrl.addChartDrawnListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been drawn"); });
jhurst 1.1 1165 )))
1166
1167
Aurelie Bertrand 84.1 1168 **void ddCtrl.addChartModelReadyListener (Function)**
jhurst 1.1 1169
Aurelie Bertrand 84.1 1170 Description: Adds a listener function for the event triggered before the chart is drawn (first display).
jhurst 1.1 1171
Aurelie Bertrand 84.1 1172 Example:
jhurst 1.1 1173
1174 (% class="box" %)
1175 (((
Aurelie Bertrand 84.1 1176 ddCtrl.addChartModelReadyListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be drawn"); });
jhurst 1.1 1177 )))
1178
1179
Aurelie Bertrand 84.1 1180 **void ddCtrl.addDimensionFilterListener (Function)**
jhurst 1.1 1181
Aurelie Bertrand 84.1 1182 Description: Adds a listener function for the event triggered after a dimension has been filtered.
jhurst 1.1 1183
Aurelie Bertrand 84.1 1184 Example:
jhurst 1.1 1185
1186 (% class="box" %)
1187 (((
Aurelie Bertrand 84.1 1188 ddCtrl.addDimensionFilterListener(function(dimension, hierarchy, level, members, membersFormatted, bExclude, min, max) { alert("The dimension " + dimension + " has been filtered to " + membersFormatted); });
jhurst 1.1 1189 )))
1190
1191
Aurelie Bertrand 84.1 1192 **void ddCtrl.addVariableChangeListener (Function)**
jhurst 1.1 1193
Aurelie Bertrand 84.1 1194 Description: Adds a listener function for the event triggered after a variable has been changed.
jhurst 1.1 1195
Aurelie Bertrand 84.1 1196 Example:
jhurst 1.1 1197
1198 (% class="box" %)
1199 (((
Aurelie Bertrand 84.1 1200 ddCtrl.addVariableChangeListener(function(variable, value) { alert("The variable " + variable + " has changed; new value: " + value); });
jhurst 1.1 1201 )))
1202
Aurelie Bertrand 67.1 1203
Aurelie Bertrand 84.1 1204 == Dashboard Event Handling{{id name="event_tdb"/}} ==
jhurst 1.1 1205
crandon 5.1 1206
Aurelie Bertrand 84.1 1207 **void ddCtrl.addDashboardLoadListener (Function)**
crandon 5.1 1208
Aurelie Bertrand 84.1 1209 Description: Adds a listener for the event triggered once the dashboard has loaded but has not yet been rendered.
crandon 5.1 1210
Aurelie Bertrand 84.1 1211 Example:
crandon 5.1 1212
1213 (% class="box" %)
1214 (((
Aurelie Bertrand 84.1 1215 ddCtrl.addDashboardLoadListener(function(currentPage) { alert("Initialising the dashboard"); });
crandon 5.1 1216 )))
1217
1218
1219
Aurelie Bertrand 84.1 1220 **void ddCtrl.addCurrentPageLoadListener (Function)**
jhurst 1.1 1221
Aurelie Bertrand 84.1 1222 Description: Adds a function to listen for the event triggered once the dashboard page has fully loaded.
jhurst 1.1 1223
Aurelie Bertrand 84.1 1224 Example:
jhurst 1.1 1225
1226 (% class="box" %)
1227 (((
Aurelie Bertrand 84.1 1228 ddCtrl.addCurrentPageLoadListener(function(currentPage) { alert("Page " + currentPage + " has been loaded"); });
jhurst 1.1 1229 )))
1230
1231
Aurelie Bertrand 84.1 1232 **void ddCtrl.addCurrentPageChangeListener (Function)**
jhurst 1.1 1233
Aurelie Bertrand 84.1 1234 Description: Adds a function to listen for the event triggered when a page changes.
jhurst 1.1 1235
Aurelie Bertrand 84.1 1236 Example:
jhurst 1.1 1237
1238 (% class="box" %)
1239 (((
Aurelie Bertrand 84.1 1240 ddCtrl.addCurrentPageChangeListener(function(currentPage, bFirstTime) { alert("The page is now " + currentPage); });
jhurst 1.1 1241 )))
1242
1243
Aurelie Bertrand 84.1 1244 **void ddCtrl.addUserLoggedListener (Function)**
jhurst 1.1 1245
Aurelie Bertrand 84.1 1246 Description: Event triggered once the user has been authenticated. May be useful when using the ddCtrl.getUserAttribute function.
jhurst 1.1 1247
Aurelie Bertrand 84.1 1248 Example:
jhurst 1.1 1249
1250 (% class="box" %)
1251 (((
Aurelie Bertrand 84.1 1252 ddCtrl.addUserLoggedListener(function() { alert("You are logged in"); });
jhurst 1.1 1253 )))
1254
1255
Aurelie Bertrand 84.1 1256 **void ddCtrl.addPortletHiddenListener (Function)**
jhurst 1.1 1257
Aurelie Bertrand 84.1 1258 Description: Event triggered when the object’s status changes from visible to hidden.
jhurst 1.1 1259
Aurelie Bertrand 84.1 1260 Example:
jhurst 1.1 1261
1262 (% class="box" %)
1263 (((
Aurelie Bertrand 84.1 1264 ddCtrl.addPortletHiddenListener(function(portletId) { alert("The object is hidden"); });
jhurst 1.1 1265 )))
1266
1267
Aurelie Bertrand 84.1 1268 **void ddCtrl.addPortletVisibleListener (Function)**
jhurst 1.1 1269
Aurelie Bertrand 84.1 1270 Description: Event triggered when the object’s status changes from hidden to visible.
jhurst 1.1 1271
Aurelie Bertrand 84.1 1272 Example:
jhurst 1.1 1273
1274 (% class="box" %)
1275 (((
Aurelie Bertrand 84.1 1276 ddCtrl.addPortletVisibleListener(function(portletId) { alert("The object is visible"); });
jhurst 1.1 1277 )))
1278
1279
Aurelie Bertrand 84.1 1280 **void ddCtrl.addPortletCollapseListener (Function)**
jhurst 1.1 1281
Aurelie Bertrand 84.1 1282 Description: Event triggered when the user clicks the icon to hide a retractable element.
jhurst 1.1 1283
Aurelie Bertrand 84.1 1284 Example:
jhurst 1.1 1285
1286 (% class="box" %)
1287 (((
Aurelie Bertrand 84.1 1288 ddCtrl.addPortletCollapseListener(function(portletId) { alert("The object is about to be hidden"); });
jhurst 1.1 1289 )))
1290
1291
Aurelie Bertrand 84.1 1292 **void ddCtrl.addPortletCollapsedListener (Function)**
jhurst 1.1 1293
Aurelie Bertrand 84.1 1294 Description: Event triggered once the retractable element has been hidden.
jhurst 1.1 1295
Aurelie Bertrand 84.1 1296 Example:
jhurst 1.1 1297
1298 (% class="box" %)
1299 (((
Aurelie Bertrand 84.1 1300 ddCtrl.addPortletCollapsedListener(function(portletId) { alert("The object is hidden"); });
jhurst 1.1 1301 )))
1302
1303
Aurelie Bertrand 84.1 1304 **void ddCtrl.addPortletExpandListener (Function)**
jhurst 1.1 1305
Aurelie Bertrand 84.1 1306 Description: Event triggered when the user clicks the icon to expand a retractable element.
jhurst 1.1 1307
Aurelie Bertrand 84.1 1308 Example:
jhurst 1.1 1309
1310 (% class="box" %)
1311 (((
Aurelie Bertrand 84.1 1312 ddCtrl.addPortletExpandListener(function(portletId) { alert("The object is about to be displayed"); });
jhurst 1.1 1313 )))
1314
1315
Aurelie Bertrand 84.1 1316 **void ddCtrl.addPortletExpandedListener (Function)**
jhurst 1.1 1317
Aurelie Bertrand 84.1 1318 Description: Event triggered once the retractable element has been displayed.
jhurst 1.1 1319
Aurelie Bertrand 84.1 1320 Example:
jhurst 1.1 1321
1322 (% class="box" %)
1323 (((
Aurelie Bertrand 84.1 1324 ddCtrl.addPortletExpandedListener(function(portletId) { alert("The object is displayed"); });
jhurst 1.1 1325 )))
1326
1327
Aurelie Bertrand 84.1 1328 **void ddCtrl.addGroupOfTabsChangeListener (Function)**
jhurst 1.1 1329
Aurelie Bertrand 84.1 1330 Description: Event triggered when the user changes the chart within a group of tabs. The first parameter is the identifier of the group of tabs object; the second is the identifier of the current portlet.
jhurst 1.1 1331
Aurelie Bertrand 84.1 1332 Example:
jhurst 1.1 1333
1334 (% class="box" %)
1335 (((
Aurelie Bertrand 84.1 1336 ddCtrl.addGroupOfTabsChangeListener(function(portletTabId, curPortletId) { alert("The current portlet is: " + curPortletId); });
jhurst 1.1 1337 )))
1338
1339
Aurelie Bertrand 84.1 1340 **void ddCtrl.addDocumentUploadListener (Function)**
jhurst 1.1 1341
Aurelie Bertrand 84.1 1342 Description: event triggered when the user adds a file via the dashboard.
jhurst 1.1 1343
Aurelie Bertrand 84.1 1344 Example:
jhurst 1.1 1345
1346 (% class="box" %)
1347 (((
Aurelie Bertrand 84.1 1348 ddCtrl.addDocumentUploadListener(function(serverName, filesName) { alert("The file " + filesName[0] + " has been successfully added"); });
jhurst 1.1 1349 )))
1350
Aurelie Bertrand 68.1 1351
Aurelie Bertrand 84.1 1352 **void ddCtrl.addScalingZoomListener(function(zoomConfig){}) (Function){{id name="event_scale"/}}**
Aurelie Bertrand 68.1 1353
Aurelie Bertrand 84.1 1354 Description: Adds a listener for the event triggered after a change in the zoom level for a page in Scale or Grid + Scale mode.
Aurelie Bertrand 68.1 1355
Aurelie Bertrand 84.1 1356 Example:
Aurelie Bertrand 68.1 1357
1358 (% class="box" %)
1359 (((
1360 ddCtrl.addScalingZoomListener(function(zoomConfig){
Aurelie Bertrand 84.1 1361 console.log("The zoom level has been changed: " + JSON.stringify(zoomConfig));
Aurelie Bertrand 68.1 1362 });
1363 )))
1364
Aurelie Bertrand 84.1 1365 = Miscellaneous functions =
Aurelie Bertrand 77.1 1366
Aurelie Bertrand 84.1 1367 **(String array) ddCtrl.getUserRoles ()**
Aurelie Bertrand 77.1 1368
Aurelie Bertrand 84.1 1369 Description: Returns the list of role IDs for the logged-in user.
Aurelie Bertrand 77.1 1370
1371
Aurelie Bertrand 84.1 1372 **(Associative array of strings / booleans) ddCtrl.getUserACLs ()**
Aurelie Bertrand 77.1 1373
Aurelie Bertrand 84.1 1374 Description: Returns a list of the access control list (ACL) IDs for the logged-in user. The returned list is an associative array linking the ACL ID to a Boolean (true) if the ACL is granted to the user.
Aurelie Bertrand 77.1 1375
Aurelie Bertrand 84.1 1376 Example:
Aurelie Bertrand 77.1 1377
Aurelie Bertrand 76.1 1378 (% class="box" %)
1379 (((
Aurelie Bertrand 84.1 1380 if (ddCtrl.getUserACLs()['SaveAsPPT']) alert("You can save as PPT");
Aurelie Bertrand 76.1 1381 )))
1382
Aurelie Bertrand 84.1 1383 List of all possible authorizations:
jhurst 1.1 1384
Aurelie Bertrand 84.1 1385 AccessDBV, AccessDBE, EditDashboardForGroup, LoadWalletForGroup, SaveWalletForGroup, AddFlow, AddRoleFlow, RefreshFlow, RefreshRoleFlow, AccessServerSettings, AccessUserSettings, AccessLicenseSettings, AccessContentManagement, Scheduler, EditDataSourceForGroup, EditDataSource, SaveAsPDF, SaveAsPPT, SaveAsXLS, SaveAsXLSWithoutStyles, SaveAsCSV, ChartNavigation, SendSMS, UploadDocument, UpdateDocument, ListDocumentServers, ListDocuments, ViewComments, AddCommentDataModel, RemoveCommentDataModel, AddCommentFlow, RemoveCommentFlow, AllowIgnoreDMResivion, DashboardCustomization, DashboardJSCustom, DashboardTheme, EditProtectedDashboardPages, DashboardOfflineMode, DashboardNavigationMenu, DictionaryManager, DeviceManager, FormatManager, DBConnectionManager, ColorPaletteManager, PredefinedFunctionManager, StylesManager, HierarchyManager, IconManager, MapManager, ManageACLGroup, ManageProfil, AccessServerStatus, AccessBackup, AccessRestore, ManageScripts, ManageSentences, ManageRole, ManageAllRoles, ManageSchedules, ManageD3, PrintChart, EditUserAttributes, EditUserVariables, AssignProfil, ManageACL, EditProtectedUserVariables, UseAdHocAnalysis, SaveView, SavePublicView, ViewRestrictedData, DependencyAnalyser, TextQuery, AccessStudio, AccessDashboardAssistant, ViewAllComments, DownloadFromCMDR, CreateForm, AddFormData, ManageFormData, ManageAllForms, AllowImpersonate, ManageCommonItems, ManageRoleItems, ExportUsers, ImportUsers, ViewAllUsersInfo, SendMail, AddRole, EditFileDataSource, EditDBDataSource, EditReportDataSource, EditUnionDataSource, EditJoinDataSource, EditTransformerDataSource, EditColTransformerDataSource, EditIODataSource, EditDataCatalogDataSource, AllowSetQuotaByModel, ManageUserParams
jhurst 1.1 1386
1387
Aurelie Bertrand 84.1 1388 **(String) ddCtrl.getUserAttribute (attr)**
jhurst 1.1 1389
Aurelie Bertrand 84.1 1390 Description: Returns the user’s LDAP attribute <attr>.
jhurst 1.1 1391
1392
Aurelie Bertrand 84.1 1393 **(String) ddCtrl.getUserAttribute (attr, Function)**
jhurst 1.1 1394
Aurelie Bertrand 84.1 1395 Description: Returns the user’s LDAP attribute <attr> via an asynchronous call function.
jhurst 1.1 1396
Aurelie Bertrand 84.1 1397 Example:
jhurst 1.1 1398
1399 (% class="box" %)
1400 (((
1401 ddCtrl.getUserAttribute('displayName', function (attrVal) {alert(attrVal)});
1402 )))
1403
1404
Aurelie Bertrand 84.1 1405 **(String) ddCtrl.getSessionAttribute (attr)**
jhurst 1.1 1406
Aurelie Bertrand 84.1 1407 Description: Returns the <attr> attribute of the user’s session.
jhurst 1.1 1408
Aurelie Bertrand 84.1 1409 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1410
1411
Aurelie Bertrand 84.1 1412 **(String) ddCtrl.getSessionAttribute (attr, Function)**
jhurst 1.1 1413
Aurelie Bertrand 84.1 1414 Description: Returns the <attr> attribute of the user session via an asynchronous callback function.
jhurst 1.1 1415
Aurelie Bertrand 84.1 1416 Example:
jhurst 1.1 1417
1418 (% class="box" %)
1419 (((
Aurelie Bertrand 84.1 1420 ddCtrl.getSessionAttribute('regionSelected', function (attrVal) {alert(attrVal)});
jhurst 1.1 1421 )))
1422
Aurelie Bertrand 84.1 1423 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1424
1425
Aurelie Bertrand 84.1 1426 **void ddCtrl.setSessionAttribute (attr, value)**
jhurst 1.1 1427
Aurelie Bertrand 84.1 1428 Description: Updates the <attr> attribute of the user session with the specified value.
jhurst 1.1 1429
Aurelie Bertrand 84.1 1430 Example:
jhurst 1.1 1431
1432 (% class="box" %)
1433 (((
Aurelie Bertrand 84.1 1434 ddCtrl.setSessionAttribute('regionSelected', ‘France’);
jhurst 1.1 1435 )))
1436
Aurelie Bertrand 84.1 1437 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1438
1439
Aurelie Bertrand 84.1 1440 **(String) ddCtrl.getServerAttribute (attr)**
jhurst 1.1 1441
Aurelie Bertrand 84.1 1442 Description: Returns the <ATTR> attribute of the server. Server attributes (or variables) allow you to specify constants used in data models and Flows via the keyword ${server.<ATTR>}.
jhurst 1.1 1443
Aurelie Bertrand 84.1 1444 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
jhurst 1.1 1445
1446
Aurelie Bertrand 84.1 1447 **(String) ddCtrl.getServerAttribute (attr, Function)**
jhurst 1.1 1448
Aurelie Bertrand 84.1 1449 Description: Returns the <attr> server attribute via an asynchronous call.
jhurst 1.1 1450
Aurelie Bertrand 84.1 1451 Example:
jhurst 1.1 1452
1453 (% class="box" %)
1454 (((
1455 ddCtrl.getSessionAttribute('serverMode', function (attrVal) {alert(attrVal)});
1456 )))
1457
Aurelie Bertrand 84.1 1458 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
jhurst 1.1 1459
1460
Aurelie Bertrand 84.1 1461 **(String) ddCtrl.getUserStorage (attr)**
crandon 5.1 1462
Aurelie Bertrand 84.1 1463 Description: Returns the <attr> attribute of the specified user that was previously saved.
crandon 5.1 1464
Aurelie Bertrand 84.1 1465 Example:
crandon 5.1 1466
1467 (% class="box" %)
1468 (((
Aurelie Bertrand 84.1 1469 var value = ddCtrl.getUserStorage('attribute');
crandon 5.1 1470 )))
1471
Aurelie Bertrand 84.1 1472 **void ddCtrl.setUserStorage (attr, value)**
crandon 5.1 1473
Aurelie Bertrand 84.1 1474 Description: Saves the user’s <attr> attribute persistently on the server for future use.
crandon 5.1 1475
Aurelie Bertrand 84.1 1476 Example:
crandon 5.1 1477
1478 (% class="box" %)
1479 (((
Aurelie Bertrand 84.1 1480 ddCtrl.setUserStorage('attribute', 'value');
crandon 5.1 1481 )))
1482
1483
Aurelie Bertrand 84.1 1484 **void ddCtrl.fireRefreshEvent (event)**
crandon 5.1 1485
Aurelie Bertrand 84.1 1486 Description: Triggers a server-side refresh of the data associated with the specified event
crandon 6.1 1487
Aurelie Bertrand 84.1 1488 Example:
crandon 6.1 1489
1490 (% class="box" %)
1491 (((
Aurelie Bertrand 84.1 1492 ddCtrl.fireRefreshEvent('DAILY_UPDATE');
crandon 6.1 1493 )))
1494
1495
Aurelie Bertrand 84.1 1496 **void ddCtrl.newAuthToken ()**
crandon 8.1 1497
Aurelie Bertrand 84.1 1498 Description: Returns an authentication token generated for the current session.
crandon 8.1 1499
Aurelie Bertrand 84.1 1500 Example:
crandon 8.1 1501
1502 (% class="box" %)
1503 (((
1504 var token = ddCtrl.newAuthToken();
1505
Aurelie Bertrand 27.1 1506 window.open("http:~/~/localhost:8080/digdash_dashboard/index.html?user=mon_user&authToken=token");
crandon 8.1 1507 )))
1508
1509
Aurelie Bertrand 84.1 1510 **void loadCSS(cssFile)**
jhurst 1.1 1511
Aurelie Bertrand 84.1 1512 Description: Loads a CSS file.
jhurst 1.1 1513
1514
1515 **void ddCtrl.loadTheme (cssTheme)**
1516
Aurelie Bertrand 84.1 1517 Description: Loads a DigDash CSS theme onto the dashboard.
jhurst 1.1 1518
Aurelie Bertrand 84.1 1519 Example:
jhurst 1.1 1520
1521 (% class="box" %)
1522 (((
1523 ddCtrl.loadTheme(‘digdash’);
1524 )))
1525
crandon 6.1 1526 **void ddCtrl.removeTheme (cssTheme)**
jhurst 1.1 1527
Aurelie Bertrand 84.1 1528 Description: Removes the DigDash CSS theme from the dashboard.
crandon 6.1 1529
Aurelie Bertrand 84.1 1530 Example:
crandon 6.1 1531
1532 (% class="box" %)
1533 (((
Aurelie Bertrand 84.1 1534 ddCtrl.removeTheme('digdash');
crandon 6.1 1535 )))
1536
Aurelie Bertrand 84.1 1537 **void openFormInWindow (portlet, width, height, dimension, member [, dimension, member, ...])**
crandon 9.1 1538
Aurelie Bertrand 84.1 1539 Description: Opens a form (where `portlet` is the form object added to a dashboard page) in a pop-up window and filters it by the dimension(s) and member(s) specified as parameters (a list of dimension/member pairs).
crandon 9.1 1540
Aurelie Bertrand 84.1 1541 Example:
crandon 9.1 1542
1543 (% class="box" %)
1544 (((
Aurelie Bertrand 84.1 1545 <a href="javascript:__ddCtrl.openFormInWindow__('portletId', '80%', '80%', 'Year', '2024', 'Country', 'France')">Displays the form with the values ‘France 2024’</a>
crandon 9.1 1546 )))
1547
abertrand 12.1 1548
Aurelie Bertrand 84.1 1549 **void initFormData (portlet, field name, field value [, name, value, ...])**
crandon 9.1 1550
Aurelie Bertrand 84.1 1551 Description: Initialises a form with the values specified as parameters (a list of key-value pairs for the form fields).
crandon 9.1 1552
Aurelie Bertrand 84.1 1553 Example:
crandon 9.1 1554
1555 (% class="box" %)
1556 (((
Aurelie Bertrand 84.1 1557 <a href="javascript:__ddCtrl.initFormData__('1906313430','//f_project_name//','DigDash')">Initialises the form with the value ‘DigDash’ for the ‘Project Name’ field</a>
crandon 9.1 1558 )))
1559
Aurelie Bertrand 84.1 1560 * To retrieve the portlet ID, open the portlet’s **Information** tab in the Dashboard Editor and copy **the Unique ID**.
1561 * To retrieve the key for a form field: edit the form, click the **‘Edit JSON** ’ button in the top right-hand corner of the form and copy the ‘key’ value: in this example, //‘f_project_name//’.
crandon 9.1 1562
jhurst 1.1 1563 **void logout ()**
1564
Aurelie Bertrand 84.1 1565 Description: Logs out the current user.