Wiki source code of Dashboard API

Last modified by Aurelie Bertrand on 2026/06/29 17:48

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 74.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 74.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 74.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 74.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 74.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 74.1 19 = Variable functions (DDVariables) =
jhurst 1.1 20
Aurelie Bertrand 58.1 21 (% class="wikigeneratedid" id="HvoidddCtrl.changeVariable28nom2Cvaleur29" %)
Aurelie Bertrand 74.1 22 **void ddCtrl.{{id name="changeVariable"/}} changeVariable(name, value)**
jhurst 1.1 23
Aurelie Bertrand 74.1 24 Description: Changes the value of the variable <name>.
jhurst 1.1 25
Aurelie Bertrand 74.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 74.1 34 **(Number) ddCtrl.getDDVar(name)**
jhurst 1.1 35
Aurelie Bertrand 74.1 36 Description: Returns the value of the variable <name>.
jhurst 1.1 37
Aurelie Bertrand 74.1 38 Example:
jhurst 1.1 39
40 (% class="box" %)
41 (((
Aurelie Bertrand 74.1 42 <a href="javascript:ddCtrl.changeVariable('ratioEuro', __ddCtrl.getDDVar__('ratioEuro') + 0.1)">Increase EuroDollar</a>
jhurst 1.1 43 )))
44
Aurelie Bertrand 74.1 45 = Data filtering and navigation functions =
jhurst 1.1 46
Aurelie Bertrand 74.1 47 **FilterOperand (dimension, member, hierarchy, level, formattedMember, bAddFilter, bExcludeFilter)**
jhurst 1.1 48
Aurelie Bertrand 74.1 49 Description: Object used to specify the filter to be applied.
jhurst 1.1 50
Aurelie Bertrand 74.1 51 Example:
jhurst 1.1 52
53 (% class="box" %)
54 (((
Aurelie Bertrand 74.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 74.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 74.1 64 **FilterOperandContinuous (dimension, min, max, bExcludeFilter)**
jhurst 1.1 65
Aurelie Bertrand 74.1 66 Description: Object used to specify the interval filter to be applied to a continuous dimension.
jhurst 1.1 67
Aurelie Bertrand 74.1 68 Example:
jhurst 1.1 69
70 (% class="box" %)
71 (((
Aurelie Bertrand 74.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 74.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 74.1 81 **FilterOperandMatch (dimension, hierarchy, level, [values], [operators], mode, ExcludeFilter)**
crandon 9.1 82
Aurelie Bertrand 74.1 83 Description: Object used to specify a ‘Rule’ type filter to be applied to a continuous dimension.
crandon 9.1 84
Aurelie Bertrand 74.1 85 Example:
crandon 9.1 86
87 (% class="box" %)
88 (((
Aurelie Bertrand 74.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 74.1 94 //Note~://
crandon 9.1 95
Aurelie Bertrand 74.1 96 //The ‘Operators’ table contains the filter type for each rule~://
crandon 9.1 97
Aurelie Bertrand 74.1 98 //0: not empty//
crandon 9.1 99
Aurelie Bertrand 74.1 100 //1: is empty//
crandon 9.1 101
Aurelie Bertrand 74.1 102 //2: is equal to//
crandon 9.1 103
Aurelie Bertrand 74.1 104 //3: contains//
crandon 9.1 105
Aurelie Bertrand 74.1 106 //4: does not contain//
crandon 9.1 107
Aurelie Bertrand 74.1 108 //5: is not equal to//
crandon 9.1 109
Aurelie Bertrand 74.1 110 //6: matches the regular expression//
crandon 9.1 111
Aurelie Bertrand 74.1 112 //7: contains the word//
crandon 9.1 113
Aurelie Bertrand 74.1 114 //8: does not contain the word//
crandon 9.1 115
Aurelie Bertrand 74.1 116 //9: is greater than//
crandon 9.1 117
Aurelie Bertrand 74.1 118 //10: is less than//
crandon 9.1 119
Aurelie Bertrand 74.1 120 //11: is greater than or equal to//
crandon 9.1 121
Aurelie Bertrand 74.1 122 //12: is less than or equal to//
crandon 9.1 123
Aurelie Bertrand 74.1 124 //13: starts with//
crandon 9.1 125
Aurelie Bertrand 74.1 126 //14: ends with//
crandon 9.1 127
Aurelie Bertrand 74.1 128 //15: is contained in//
crandon 9.1 129
Aurelie Bertrand 74.1 130 //16: is not contained in//
crandon 9.1 131
Aurelie Bertrand 74.1 132 //The values table contains the required values corresponding to the filter type.//
crandon 9.1 133 )))
134
135
Aurelie Bertrand 74.1 136 **void ddCtrl.filter (dimension, member)**
jhurst 1.1 137
Aurelie Bertrand 74.1 138 Description: filters by a dimension.
jhurst 1.1 139
Aurelie Bertrand 74.1 140 Example:
jhurst 1.1 141
142 (% class="box" %)
143 (((
Aurelie Bertrand 74.1 144 <a href="javascript:__ddCtrl.filter__('Pays', 'France')">Filter France</a>
jhurst 1.1 145 )))
146
147 (% class="box infomessage" %)
148 (((
Aurelie Bertrand 74.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 74.1 155 Description: Filters on a dimension by specifying a hierarchy and a level.
jhurst 1.1 156
Aurelie Bertrand 74.1 157 Example:
jhurst 1.1 158
159 (% class="box" %)
160 (((
Aurelie Bertrand 74.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 74.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 74.1 172 Description: Filters a chart by a dimension by specifying a hierarchy and a level.
crandon 5.1 173
Aurelie Bertrand 74.1 174 Example:
crandon 5.1 175
176 (% class="box" %)
177 (((
Aurelie Bertrand 74.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 74.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 74.1 187 **void ddCtrl.filterAndChangePage (page, dimension, member)**
jhurst 1.1 188
Aurelie Bertrand 74.1 189 Description: filters by a dimension and changes the page.
jhurst 1.1 190
Aurelie Bertrand 74.1 191 Example:
jhurst 1.1 192
193 (% class="box" %)
194 (((
Aurelie Bertrand 74.1 195 <a href="javascript:__ddCtrl.filterAndChangePage__('Production.Details Country', 'Country', 'France')">France Details</a>
jhurst 1.1 196 )))
197
198
Aurelie Bertrand 74.1 199 **void ddCtrl.changePageAndFilter (page, dimension, member)**
crandon 8.1 200
Aurelie Bertrand 74.1 201 Description: changes the page and filters by a dimension.
crandon 8.1 202
Aurelie Bertrand 74.1 203 Example:
crandon 8.1 204
205 (% class="box" %)
206 (((
Aurelie Bertrand 74.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 74.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 74.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 74.1 223 **(String Array) ddCtrl.getDimensionFilter (dimension [, bContinue])**
jhurst 1.1 224
Aurelie Bertrand 74.1 225 Description: Returns the list of elements filtered by the dimension (continuous or discrete).
jhurst 1.1 226
Aurelie Bertrand 74.1 227 Example:
jhurst 1.1 228
229 (% class="box" %)
230 (((
Aurelie Bertrand 74.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 74.1 237 Description: Returns true if the dimension (continuous or discrete) is filtered. Returns false otherwise.
jhurst 1.1 238
Aurelie Bertrand 74.1 239 Example:
jhurst 1.1 240
241 (% class="box" %)
242 (((
Aurelie Bertrand 74.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 74.1 249 Description: Removes all filters from the dashboard.
jhurst 1.1 250
Aurelie Bertrand 74.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 74.1 261 Description: Removes the filters from the current page.
jhurst 1.1 262
Aurelie Bertrand 74.1 263 Example:
jhurst 1.1 264
265 (% class="box" %)
266 (((
Aurelie Bertrand 74.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 74.1 273 Description: Removes the current filters on the dimension (continuous or discrete).
jhurst 1.1 274
275 (% class="box" %)
276 (((
Aurelie Bertrand 74.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 74.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 74.1 287 Example:
jhurst 1.1 288
289 (% class="box" %)
290 (((
Aurelie Bertrand 74.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 74.1 295 **void ddCtrl.setDimensionNavigation (dimension, {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bNavigation)**
jhurst 1.1 296
Aurelie Bertrand 74.1 297 Description: Changes the permission to navigate by a dimension for the specified flow.
jhurst 1.1 298
Aurelie Bertrand 74.1 299 Example:
jhurst 1.1 300
301 (% class="box" %)
302 (((
Aurelie Bertrand 74.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 74.1 307 **(String array) ddCtrl.getCurrentDrill (portlet, dimension[, hierarchy])**
jhurst 1.1 308
Aurelie Bertrand 74.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 74.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 74.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 74.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 74.1 335 Example:
jhurst 1.1 336
337 (% class="box" %)
338 (((
Aurelie Bertrand 74.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 74.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 74.1 347 Example:
jhurst 1.1 348
349 (% class="box" %)
350 (((
Aurelie Bertrand 74.1 351 See example above (getBreadPath)
jhurst 1.1 352 )))
353
354
Aurelie Bertrand 74.1 355 **void ddCtrl.drillDown (portletId, dimension, hierarchy, level, member, formattedMember)**
jhurst 1.1 356
Aurelie Bertrand 74.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 74.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 74.1 364 Example:
jhurst 1.1 365
366 (% class="box" %)
367 (((
Aurelie Bertrand 74.1 368 <a href="javascript:__ddCtrl.drillTo__('portletId', 'Location', 'Geographic', 'FR', 'France')">France Details</a>0
jhurst 1.1 369 )))
370
371
Aurelie Bertrand 74.1 372 **void ddCtrl.resetDrill (portlet, dimension, [hierarchy])**
jhurst 1.1 373
Aurelie Bertrand 74.1 374 Description: Resets navigation on the dimension hierarchy.
jhurst 1.1 375
376 (% class="box infomessage" %)
377 (((
Aurelie Bertrand 74.1 378 Note: The action is performed on all charts sharing the same navigation interaction (“synchronised drill”).
jhurst 1.1 379 )))
380
Aurelie Bertrand 74.1 381 Example:
jhurst 1.1 382
383 (% class="box" %)
384 (((
Aurelie Bertrand 74.1 385 <a href="javascript:__ddCtrl.resetDrill__('portletId', 'Location')">Back to the world map</a>
jhurst 1.1 386 )))
387
388
Aurelie Bertrand 74.1 389 **void ddCtrl.selectMeasuresOnChart(portlet, [measures])**
crandon 6.1 390
Aurelie Bertrand 74.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 74.1 393 Example:
crandon 6.1 394
395 (% class="box" %)
396 (((
Aurelie Bertrand 74.1 397 <a href="javascript:__selectMeasuresOnChart__('portletId2', ['Turnover', 'Margins'])">Display Turnover and Margins</a>
crandon 6.1 398 )))
399
400
401
Aurelie Bertrand 74.1 402 **(Number | String) ddCtrl.getDataModelDate (dmId, bFormat)**
jhurst 1.1 403
Aurelie Bertrand 74.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 74.1 408 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
jhurst 1.1 409 )))
410
Aurelie Bertrand 74.1 411 Example:
jhurst 1.1 412
413 (% class="box" %)
414 (((
Aurelie Bertrand 74.1 415 <a href="javascript:alert(__ddCtrl.getDataModelDate__('a1234567890..', true))">Display the data date</a>
jhurst 1.1 416 )))
417
418
Aurelie Bertrand 74.1 419 **(Number | String) ddCtrl.getDataModelLinesCount (dmId)**
crandon 8.1 420
Aurelie Bertrand 74.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 74.1 423 Example:
crandon 8.1 424
425 (% class="box" %)
426 (((
Aurelie Bertrand 74.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 74.1 432 **(Number | String) ddCtrl.getFlowDate ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, bFormat)**
jhurst 1.1 433
Aurelie Bertrand 74.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 74.1 438 Note: The timestamp is the number of milliseconds elapsed since 1 January 1970.
jhurst 1.1 439 )))
440
Aurelie Bertrand 74.1 441 Example:
jhurst 1.1 442
443 (% class="box" %)
444 (((
Aurelie Bertrand 74.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 74.1 448 = Data query functions =
jhurst 1.1 449
Aurelie Bertrand 74.1 450 **(Number | String) ddCtrl.getResultCubeValue ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, measure, lMembers, bFormatted)**
jhurst 1.1 451
Aurelie Bertrand 74.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 74.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 74.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 74.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 74.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 74.1 468 **(Row table) ddCtrl.getResultCubeRowSet ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}, oAxisMemberQuery [, bFormatted])**
jhurst 1.1 469
Aurelie Bertrand 74.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 74.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 74.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 74.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 74.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 74.1 490 **(Number) ddCtrl.getResultCubeLinesCount ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 491
Aurelie Bertrand 74.1 492 Description: Returns the number of flattened rows in the result cube.
jhurst 1.1 493
Aurelie Bertrand 74.1 494 Example:
jhurst 1.1 495
496 (% class="box" %)
497 (((
Aurelie Bertrand 74.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 74.1 503 **ddCtrl.getLastDimensionDate('data model ID', 'Time dimension')**
abertrand 13.1 504
505 (% class="wikigeneratedid" %)
Aurelie Bertrand 74.1 506 Description: Returns the maximum date of a time dimension as a timestamp.
abertrand 13.1 507
508 (% class="wikigeneratedid" %)
Aurelie Bertrand 74.1 509 Example:
abertrand 13.1 510
abertrand 14.1 511 (% class="box" %)
512 (((
Aurelie Bertrand 74.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 74.1 517 **ddCtrl.getCubeValue ("data model ID", [filters], 'dimension or measure name', bUseContext)**
Aurelie Bertrand 36.1 518
Aurelie Bertrand 74.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 74.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 74.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 74.1 529 **ddCtrl.getFlowValue ("flow ID", [filters], 'dimension or measure name', bUseContext)**
Aurelie Bertrand 36.1 530
Aurelie Bertrand 74.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 74.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 74.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 74.1 541 = Dashboard functions{{id name="Fonction_TDB"/}} =
jhurst 1.1 542
Aurelie Bertrand 35.1 543 (% class="box infomessage" %)
544 (((
Aurelie Bertrand 74.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 74.1 550 Description: Loads a JavaScript file from a URL.
jhurst 1.1 551
Aurelie Bertrand 74.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 74.1 560 **void ddCtrl.includeJS (JS_name)**
jhurst 1.1 561
Aurelie Bertrand 74.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 74.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 74.1 572 **void ddCtrl.drawFlowInElement ('HTML element or widget ID', '{{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}} ID');**
jhurst 1.1 573
Aurelie Bertrand 74.1 574 Description: Displays a flow within an HTML element
Aurelie Bertrand 31.1 575
Aurelie Bertrand 74.1 576 Example (in the JavaScript editor):
Aurelie Bertrand 31.1 577
Aurelie Bertrand 34.1 578 (% class="box" %)
579 (((
Aurelie Bertrand 74.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 74.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 74.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 74.1 596 Description: Changes the current page to <page>.
jhurst 1.1 597
Aurelie Bertrand 74.1 598 Example:
jhurst 1.1 599
600 (% class="box" %)
601 (((
Aurelie Bertrand 74.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 74.1 608 Description: Moves to the next page (same function).
jhurst 1.1 609
Aurelie Bertrand 74.1 610 Example:
jhurst 1.1 611
612 (% class="box" %)
613 (((
Aurelie Bertrand 74.1 614 <a href="javascript:__ddCtrl.nextPage__()">Next page</a>
jhurst 1.1 615 )))
616
617
618 **void ddCtrl.prevPage ()**
619
Aurelie Bertrand 74.1 620 Description: Moves to the previous page (same role).
jhurst 1.1 621
Aurelie Bertrand 74.1 622 Example:
jhurst 1.1 623
624 (% class="box" %)
625 (((
Aurelie Bertrand 74.1 626 <a href="javascript:__ddCtrl.prevPage__()">Previous page</a>
jhurst 1.1 627 )))
628
629
Aurelie Bertrand 74.1 630 **(Boolean) ddCtrl.isCurrentPage (page)**
jhurst 1.1 631
Aurelie Bertrand 74.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 74.1 636 Note: This function replaces the deprecated function __ddCtrl.getCurrentPage__ ()
jhurst 1.1 637 )))
638
639
Aurelie Bertrand 74.1 640 **(String) ddCtrl.getCurrentPage ()**
jhurst 1.1 641
Aurelie Bertrand 74.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 74.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 74.1 650 **(Boolean) ddCtrl.isPageLoaded(page)**
crandon 6.1 651
Aurelie Bertrand 74.1 652 Description: Returns true if the specified page has already been loaded. Returns false otherwise.
crandon 6.1 653
654
Aurelie Bertrand 74.1 655 **(Boolean) ddCtrl.isCurrentPageLoaded()**
Aurelie Bertrand 56.1 656
Aurelie Bertrand 74.1 657 Description: Returns true if the current page has already been loaded. Returns false otherwise.
Aurelie Bertrand 56.1 658
659
Aurelie Bertrand 74.1 660 **(Object) ddCtrl.getPage(page)**
crandon 6.1 661
Aurelie Bertrand 74.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 74.1 665 **(Array) ddCtrl.getPagePath (page)**
crandon 6.1 666
Aurelie Bertrand 74.1 667 Description: Returns an array containing the page path (role / page group / page).
crandon 6.1 668
669
Aurelie Bertrand 74.1 670 **(Array) ddCtrl.dashboardPages**
crandon 6.1 671
Aurelie Bertrand 74.1 672 Description: An array containing all the pages for all roles of the logged-in user.
crandon 6.1 673
Aurelie Bertrand 74.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 74.1 685
Aurelie Bertrand 46.1 686 )))
687
Aurelie Bertrand 74.1 688 **(Boolean) canChangeCurrentPage (page)**
Aurelie Bertrand 46.1 689
Aurelie Bertrand 74.1 690 Description: Returns true if it is possible to switch to the page <page>. Returns false otherwise.
jhurst 1.1 691
692
693 **void ddCtrl.hidePage (page)**
694
Aurelie Bertrand 74.1 695 Description: Hides the tab for page <page> if it is visible, without changing the current page.
jhurst 1.1 696
Aurelie Bertrand 74.1 697 Example:
jhurst 1.1 698
699 (% class="box" %)
700 (((
Aurelie Bertrand 74.1 701 <a href="javascript:__ddCtrl.hidePage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Global')">Exit details</a>
jhurst 1.1 702 )))
703
704
705 **void ddCtrl.showPage (page)**
706
Aurelie Bertrand 74.1 707 Description: Displays the tab for page <page> if it is hidden, without changing the current page.
jhurst 1.1 708
Aurelie Bertrand 74.1 709 Example:
jhurst 1.1 710
711 (% class="box" %)
712 (((
Aurelie Bertrand 74.1 713 <a href="javascript:__ddCtrl.showPage__('Production.Détails Pays'); __ddCtrl.changePage__('Production.Détails Pays')">Show details</a>
jhurst 1.1 714 )))
715
716
Aurelie Bertrand 74.1 717 **void ddCtrl.openFlowInWindow (flow, iWidth, iHeight)**
jhurst 1.1 718
Aurelie Bertrand 74.1 719 Description: Opens a flow in a pop-up window with the specified width and height.
jhurst 1.1 720
Aurelie Bertrand 74.1 721 Example:
jhurst 1.1 722
723 (% class="box" %)
724 (((
Aurelie Bertrand 74.1 725 <a href="javascript:__ddCtrl.openFlowInWindow__('fluxId', '250', '200')">Display product breakdown</a>
jhurst 1.1 726 )))
727
728
Aurelie Bertrand 74.1 729 **void ddCtrl.openPortletInWindow (portlet, iWidth, iHeight)**
jhurst 1.1 730
Aurelie Bertrand 74.1 731 Description: Opens a portlet in a pop-up window with the specified width and height.
jhurst 1.1 732
Aurelie Bertrand 74.1 733 Example:
abertrand 12.1 734
jhurst 1.1 735 (% class="box" %)
736 (((
Aurelie Bertrand 74.1 737 <a href="javascript:__ddCtrl.openPortletInWindow__('portletId', '250', '200')">Display product breakdown</a>
jhurst 1.1 738 )))
739
740
Aurelie Bertrand 74.1 741 **void ddCtrl.openFlowInWindowWithFilter (flow, iWidth, iHeight, dimension, member [, dimension, member, ...])**
jhurst 1.1 742
Aurelie Bertrand 74.1 743 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 744
745 (% class="box infomessage" %)
746 (((
Aurelie Bertrand 74.1 747 Note: Filters will only be applied to the new window.
jhurst 1.1 748 )))
749
Aurelie Bertrand 74.1 750 Example:
jhurst 1.1 751
752 (% class="box" %)
753 (((
Aurelie Bertrand 74.1 754 <a href="javascript:__ddCtrl.openFlowInWindowWithFilter__('fluxId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
jhurst 1.1 755 )))
756
757
Aurelie Bertrand 74.1 758 **void ddCtrl.openPortletInWindowWithFilter (portlet, iWidth, iHeight, dimension, member [, dimension, member, ...])**
jhurst 1.1 759
Aurelie Bertrand 74.1 760 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 761
762 (% class="box infomessage" %)
763 (((
Aurelie Bertrand 74.1 764 Note: Filters will only be applied to the new window.
jhurst 1.1 765 )))
766
Aurelie Bertrand 74.1 767 Example:
jhurst 1.1 768
769 (% class="box" %)
770 (((
Aurelie Bertrand 74.1 771 <a href="javascript:__ddCtrl.openPortletInWindowWithFilter__('portletId', '250', '200', 'Année', '2014', 'Pays', 'France')">Display details for France 2014</a>
jhurst 1.1 772 )))
773
774
Aurelie Bertrand 74.1 775 **void ddCtrl.closeFlowInWindow (flow)**
abertrand 12.1 776
Aurelie Bertrand 74.1 777 Description: Allows you to programmatically close a pop-up displayed using the **openFlowInWindow**, **openPortletInWindow** and **openFormInWindow** functions.
abertrand 12.1 778
Aurelie Bertrand 74.1 779 This function takes as a parameter the identifier that was passed to the function used to display the pop-up.
abertrand 12.1 780
Aurelie Bertrand 74.1 781 Example:
abertrand 12.1 782
Aurelie Bertrand 46.1 783 (% aria-label="Élément macro : code" contenteditable="false" role="region" tabindex="-1" %)
784 (((
Aurelie Bertrand 47.1 785 {{code}}
786 ddCtrl.openFlowInWindow('716abf12', '80%', '80%');
abertrand 12.1 787
Aurelie Bertrand 47.1 788 ddCtrl.closeFlowInWindow('716abf12')
789 {{/code}}
abertrand 12.1 790
Aurelie Bertrand 46.1 791 (% 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"]]
792 )))
793
794
jhurst 1.1 795 **void ddCtrl.openDocument (serverName, fileName)**
796
Aurelie Bertrand 74.1 797 Description: Opens a document in a new window.
jhurst 1.1 798
Aurelie Bertrand 74.1 799 Example:
jhurst 1.1 800
801 (% class="box" %)
802 (((
Aurelie Bertrand 74.1 803 <a href="javascript:__ddCtrl.openDocument__('Common Datasources', 'catalogue_produits.pdf')">Display the product catalogue</a>
jhurst 1.1 804 )))
805
806
807 **void ddCtrl.uploadDocument (serverName, fileName)**
808
Aurelie Bertrand 74.1 809 Description: Uploads a document to a document server. Opens a file selection window on the workstation.
jhurst 1.1 810
Aurelie Bertrand 74.1 811 Example:
jhurst 1.1 812
813 (% class="box" %)
814 (((
Aurelie Bertrand 74.1 815 <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 816 )))
817
818
Aurelie Bertrand 24.1 819 **void ddCtrl.deleteDocument (serverName, fileName)**
820
Aurelie Bertrand 74.1 821 Description: Deletes a document from the document server.
Aurelie Bertrand 24.1 822
Aurelie Bertrand 74.1 823 Example:
Aurelie Bertrand 24.1 824
825 (% class="box" %)
826 (((
Aurelie Bertrand 74.1 827 <a href="javascript:__ddCtrl.deleteDocument__('Common Datasources', 'catalogue_produits.pdf')">Delete the product catalogue</a>
Aurelie Bertrand 24.1 828 )))
829
830
831 **void ddCtrl.downloadDocument (serverName, fileName)**
832
Aurelie Bertrand 74.1 833 Description: Downloads a document from the document server.
Aurelie Bertrand 24.1 834
Aurelie Bertrand 74.1 835 Example:
Aurelie Bertrand 24.1 836
837 (% class="box" %)
838 (((
Aurelie Bertrand 74.1 839 <a href="javascript:__ddCtrl.downloadDocument__('Common Datasources', 'catalogue_produits.pdf')">Download the product catalogue</a>
Aurelie Bertrand 24.1 840 )))
841
842
843
jhurst 1.1 844 **void ddCtrl.refreshDashboard ()**
845
Aurelie Bertrand 74.1 846 Description: Refreshes the dashboard (same behaviour as the Refresh button in the dashboard header).
jhurst 1.1 847
Aurelie Bertrand 74.1 848 Example:
jhurst 1.1 849
850 (% class="box" %)
851 (((
Aurelie Bertrand 74.1 852 <a href="javascript:__ddCtrl.refreshDashboard__()">Refresh</a>
jhurst 1.1 853 )))
854
855
Aurelie Bertrand 74.1 856 **void ddCtrl.refreshFlow (flow, [event])**
jhurst 1.1 857
Aurelie Bertrand 74.1 858 Description: Refreshes the specified flow with an optional event name.
jhurst 1.1 859
Aurelie Bertrand 74.1 860 Example:
jhurst 1.1 861
862 (% class="box" %)
863 (((
Aurelie Bertrand 74.1 864 <A href="javascript:__ddCtrl.refreshFlow__('flowId', 'MAJ_QUOTIDIENNE')">Refresh {{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}}</A>
jhurst 1.1 865 )))
866
867
Aurelie Bertrand 74.1 868 **void ddCtrl.refreshFlows ([event])**
jhurst 1.1 869
Aurelie Bertrand 74.1 870 Description: Refreshes all flows on the dashboard with an optional event name.
jhurst 1.1 871
Aurelie Bertrand 74.1 872 Example:
jhurst 1.1 873
874 (% class="box" %)
875 (((
Aurelie Bertrand 74.1 876 <a href="javascript:__ddCtrl.refreshFlows__('MAJ_QUOTIDIENNE')"> Refresh all </a>
jhurst 1.1 877 )))
878
879
Aurelie Bertrand 74.1 880 **(String) ddCtrl.getCurrentRole ()**
jhurst 1.1 881
Aurelie Bertrand 74.1 882 Description: Returns the role ID of the current page or the user’s name for a user page.
jhurst 1.1 883
884
Aurelie Bertrand 74.1 885 **(String) ddCtrl.getRole(page)**
jhurst 1.1 886
Aurelie Bertrand 74.1 887 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 888
889
890 **void ddCtrl.hidePortlet (portlet)**
891
892 **void ddCtrl.showPortlet (portlet)**
893
Aurelie Bertrand 43.1 894 (% class="box warningmessage" %)
895 (((
Aurelie Bertrand 74.1 896 ❗These functions must only be used on portlets present on the current page.
Aurelie Bertrand 43.1 897 )))
898
Aurelie Bertrand 74.1 899 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 900
Aurelie Bertrand 74.1 901 Example:
jhurst 1.1 902
903 (% class="box" %)
904 (((
Aurelie Bertrand 74.1 905 <a href="javascript:__ddCtrl.showPortlet__('portletId')">Show Details</a>
jhurst 1.1 906 )))
907
908
909 **void ddCtrl.setPortletPos (portlet, x, y)**
910
911 **void ddCtrl.setPortletSize (portlet, width, height)**
912
Aurelie Bertrand 74.1 913 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 914
Aurelie Bertrand 74.1 915 Example:
jhurst 1.1 916
917 (% class="box" %)
918 (((
Aurelie Bertrand 74.1 919 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '100', '100'); __ddCtrl.setPortletSize__('portletId', '600', '400')">Expand Details</a>
jhurst 1.1 920 )))
921
922
923 **void ddCtrl.setPortletMargins (portlet, marginTop, marginRight, marginBottom, marginLeft)**
924
Aurelie Bertrand 74.1 925 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 926
Aurelie Bertrand 74.1 927 Example:
jhurst 1.1 928
929 (% class="box" %)
930 (((
Aurelie Bertrand 74.1 931 <a href="javascript:__ddCtrl.setPortletPos__('portletId', '10', '10', '10', '10'); __ddCtrl.setPortletMargins__('portletId', '600', '400')">Change the margins</a>
jhurst 1.1 932 )))
933
934
Aurelie Bertrand 74.1 935 **(Boolean) ddCtrl.chartIsHidden (portlet)**
jhurst 1.1 936
Aurelie Bertrand 74.1 937 Description: Returns true when the portlet is hidden (see hideChart) and false otherwise.
jhurst 1.1 938
939
Aurelie Bertrand 74.1 940 **void ddCtrl.genTemplatePPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 941
Aurelie Bertrand 74.1 942 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 943
Aurelie Bertrand 74.1 944 Example:
jhurst 1.1 945
946 (% class="box" %)
947 (((
Aurelie Bertrand 74.1 948 <A href="javascript:__ddCtrl.genTemplatePPT__('Id Fabrique De Document')">Download PPT</A>
jhurst 1.1 949 )))
950
951
952 **void ddCtrl.exportCurrentPageAsPPT ()**
953
Aurelie Bertrand 74.1 954 Description: Saves the current dashboard page in PPT format. The user is offered the option to download the generated PPT.
jhurst 1.1 955
Aurelie Bertrand 74.1 956 Example:
jhurst 1.1 957
958 (% class="box" %)
959 (((
Aurelie Bertrand 74.1 960 <a href="javascript:__ddCtrl.exportCurrentPageAsPPT__()">Download this page as a PPT</a>
jhurst 1.1 961 )))
962
963
964 **void ddCtrl.exportPageAsPPT (role, page)**
965
Aurelie Bertrand 74.1 966 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).
jhurst 1.1 967
Aurelie Bertrand 74.1 968 Example:
jhurst 1.1 969
970 (% class="box" %)
971 (((
Aurelie Bertrand 74.1 972 <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 973 )))
974
975
Aurelie Bertrand 74.1 976 **void ddCtrl.genTemplatePDF(flow)**
jhurst 1.1 977
Aurelie Bertrand 74.1 978 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 979
Aurelie Bertrand 74.1 980 Example:
jhurst 1.1 981
982 (% class="box" %)
983 (((
Aurelie Bertrand 74.1 984 <A href="javascript:__ddCtrl.genTemplatePDF__('Id Fabrique De Document')">Download the PDF</A>
jhurst 1.1 985 )))
986
987
988 **void ddCtrl.exportCurrentPageAsPDF ()**
989
Aurelie Bertrand 74.1 990 Description: Saves the current dashboard page in PDF format. The user is offered the option to download the generated PDF.
jhurst 1.1 991
Aurelie Bertrand 74.1 992 Example:
jhurst 1.1 993
994 (% class="box" %)
995 (((
Aurelie Bertrand 74.1 996 <a href="javascript:__ddCtrl.exportCurrentPageAsPDF__()">Download this page as a PDF</a>
jhurst 1.1 997 )))
998
999
1000 **void ddCtrl.exportPageAsPDF (role, page)**
1001
Aurelie Bertrand 74.1 1002 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).
jhurst 1.1 1003
Aurelie Bertrand 74.1 1004 Example:
jhurst 1.1 1005
1006 (% class="box" %)
1007 (((
Aurelie Bertrand 74.1 1008 <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 1009 )))
1010
1011
Aurelie Bertrand 74.1 1012 **void ddCtrl.genTemplateXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1013
Aurelie Bertrand 74.1 1014 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 1015
Aurelie Bertrand 74.1 1016 Example:
jhurst 1.1 1017
1018 (% class="box" %)
1019 (((
Aurelie Bertrand 74.1 1020 <A href="javascript:__ddCtrl.genTemplateXLS__('Id Fabrique De Document')">Download the XLS</A>
jhurst 1.1 1021 )))
1022
Aurelie Bertrand 74.1 1023 **void ddCtrl.genTemplateHTML ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1024
Aurelie Bertrand 74.1 1025 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 1026
Aurelie Bertrand 74.1 1027 Example:
Aurelie Bertrand 29.1 1028
1029 (% class="box" %)
1030 (((
Aurelie Bertrand 74.1 1031 <A href="javascript:__ddCtrl.genTemplateHTML__('Id Fabrique De Document')">Download the HTML</A>
Aurelie Bertrand 29.1 1032 )))
1033
Aurelie Bertrand 74.1 1034 **void ddCtrl.exportAsPDF ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1035
Aurelie Bertrand 74.1 1036 Description: Saves the flow as a PDF. The user is offered the option to download the generated PDF.
jhurst 1.1 1037
1038
Aurelie Bertrand 74.1 1039 **void ddCtrl.exportAsPPT ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1040
Aurelie Bertrand 74.1 1041 Description: Saves the flow as a PPT. The user is offered the option to download the generated PPT.
jhurst 1.1 1042
1043
Aurelie Bertrand 74.1 1044 **void ddCtrl.exportAsXLS ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1045
Aurelie Bertrand 74.1 1046 Description: Saves the flow as an XLS file. The user is offered the option to download the generated XLS file.
jhurst 1.1 1047
1048
Aurelie Bertrand 74.1 1049 **void ddCtrl.exportAsXLSWithoutStyles ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1050
Aurelie Bertrand 74.1 1051 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 1052
1053
Aurelie Bertrand 74.1 1054 **void ddCtrl.exportAsCSV ({{glossaryReference glossaryId="Glossary" entryId="Flux"}}Flow{{/glossaryReference}})**
jhurst 1.1 1055
Aurelie Bertrand 74.1 1056 Description: Saves the flow as a CSV (Comma-Separated Values) file. The user is prompted to download the generated CSV file.
jhurst 1.1 1057
1058
Aurelie Bertrand 74.1 1059 **void ddCtrl.saveDashboardState (name, default)**
jhurst 1.1 1060
Aurelie Bertrand 74.1 1061 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 1062
1063
Aurelie Bertrand 74.1 1064 **(String) ddCtrl.getCurrentPortletInGroupOfTabs (portletTabId)**
jhurst 1.1 1065
Aurelie Bertrand 74.1 1066 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 1067
1068
1069 **void ddCtrl.changePortletInGroupOfTabs (portletTabId, portletId)**
1070
Aurelie Bertrand 74.1 1071 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 1072
1073
Aurelie Bertrand 74.1 1074 **(Array) ddCtrl.getCurrentPagePath ()**
jhurst 1.1 1075
Aurelie Bertrand 74.1 1076 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 1077
Aurelie Bertrand 19.1 1078
Aurelie Bertrand 18.1 1079 **void ddCtrl.expandCollapseNavigationMenu()**
1080
Aurelie Bertrand 74.1 1081 Description: Collapses the navigation menu if it is expanded, and vice versa.
Aurelie Bertrand 18.1 1082
Aurelie Bertrand 66.1 1083
Aurelie Bertrand 74.1 1084 == Scale Mode Functions{{id name="scale"/}} ==
Aurelie Bertrand 66.1 1085
Aurelie Bertrand 74.1 1086 These functions relate to zoom selection in **Scale** or **Grid + Scale** mode.
Aurelie Bertrand 66.1 1087
Aurelie Bertrand 66.2 1088 **void ddCtrl.setScalingZoom(zoom)**
1089
Aurelie Bertrand 74.1 1090 Description: Sets the zoom level to the specified value.
Aurelie Bertrand 66.2 1091
Aurelie Bertrand 74.1 1092 Example:
Aurelie Bertrand 66.2 1093
1094 (% class="box" %)
1095 (((
Aurelie Bertrand 74.1 1096 <a href="javascript:__ddCtrl.setScalingZoom(0.65)__">Set the page zoom to 65%</a>
Aurelie Bertrand 66.2 1097 )))
1098
Aurelie Bertrand 69.1 1099
Aurelie Bertrand 66.2 1100 **void ddCtrl.setScalingAdaptWidth()**
1101
Aurelie Bertrand 74.1 1102 Description: applies the ‘Adapt to width’ zoom.
Aurelie Bertrand 66.2 1103
1104
Aurelie Bertrand 69.1 1105
Aurelie Bertrand 66.2 1106 **void ddCtrl.setScalingAdaptHeight()**
1107
Aurelie Bertrand 74.1 1108 Description: applies the ‘Adapt to height’ zoom.
Aurelie Bertrand 66.2 1109
1110
Aurelie Bertrand 69.1 1111
Aurelie Bertrand 66.2 1112 **void ddCtrl.setScalingZoomRange(min, max)**
1113
Aurelie Bertrand 74.1 1114 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 1115
Aurelie Bertrand 74.1 1116 Example:
Aurelie Bertrand 66.2 1117
1118 (% class="box" %)
1119 (((
Aurelie Bertrand 74.1 1120 <a href="javascript:__setScalingZoomRange(0.4,1.2)__">Set a zoom range between 40 and 120%</a>
Aurelie Bertrand 66.2 1121 )))
1122
Aurelie Bertrand 74.1 1123 = Event handling =
jhurst 1.1 1124
Aurelie Bertrand 74.1 1125 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 1126
Aurelie Bertrand 74.1 1127 == Dashboard Events Diagram ==
jhurst 1.1 1128
Aurelie Bertrand 47.1 1129 (% 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 1130
Aurelie Bertrand 74.1 1131 **void ddCtrl.addChartBeforeRefreshListener (Function)**
jhurst 1.1 1132
Aurelie Bertrand 74.1 1133 Description: Adds a listener function for the event triggered before the chart is refreshed.
jhurst 1.1 1134
Aurelie Bertrand 74.1 1135 Example:
jhurst 1.1 1136
1137 (% class="box" %)
1138 (((
Aurelie Bertrand 74.1 1139 ddCtrl.addChartBeforeRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be refreshed"); });
jhurst 1.1 1140 )))
1141
1142
Aurelie Bertrand 74.1 1143 **void ddCtrl.addChartRefreshListener (Function)**
jhurst 1.1 1144
Aurelie Bertrand 74.1 1145 Description: Adds a function to listen for the event triggered after the chart has been refreshed.
jhurst 1.1 1146
Aurelie Bertrand 74.1 1147 Example:
jhurst 1.1 1148
1149 (% class="box" %)
1150 (((
Aurelie Bertrand 74.1 1151 ddCtrl.addChartRefreshListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been refreshed"); });
jhurst 1.1 1152 )))
1153
1154
Aurelie Bertrand 74.1 1155 **void ddCtrl.addChartDrawnListener (Function)**
jhurst 1.1 1156
Aurelie Bertrand 74.1 1157 Description: Adds a function to listen for the event triggered when the chart has finished being drawn (first display).
jhurst 1.1 1158
Aurelie Bertrand 74.1 1159 Example:
jhurst 1.1 1160
1161 (% class="box" %)
1162 (((
Aurelie Bertrand 74.1 1163 ddCtrl.addChartDrawnListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " has been drawn"); });
jhurst 1.1 1164 )))
1165
1166
Aurelie Bertrand 74.1 1167 **void ddCtrl.addChartModelReadyListener (Function)**
jhurst 1.1 1168
Aurelie Bertrand 74.1 1169 Description: Adds a listener function for the event triggered before the chart is drawn (first display).
jhurst 1.1 1170
Aurelie Bertrand 74.1 1171 Example:
jhurst 1.1 1172
1173 (% class="box" %)
1174 (((
Aurelie Bertrand 74.1 1175 ddCtrl.addChartModelReadyListener(function(doc, dm, dmsel, chart, errorMsg) { alert("The chart " + chart.title + " is about to be drawn"); });
jhurst 1.1 1176 )))
1177
1178
Aurelie Bertrand 74.1 1179 **void ddCtrl.addDimensionFilterListener (Function)**
jhurst 1.1 1180
Aurelie Bertrand 74.1 1181 Description: Adds a listener function for the event triggered after a dimension has been filtered.
jhurst 1.1 1182
Aurelie Bertrand 74.1 1183 Example:
jhurst 1.1 1184
1185 (% class="box" %)
1186 (((
Aurelie Bertrand 74.1 1187 ddCtrl.addDimensionFilterListener(function(dimension, hierarchy, level, members, membersFormatted, bExclude, min, max) { alert("The dimension " + dimension + " has been filtered to " + membersFormatted); });
jhurst 1.1 1188 )))
1189
1190
Aurelie Bertrand 74.1 1191 **void ddCtrl.addVariableChangeListener (Function)**
jhurst 1.1 1192
Aurelie Bertrand 74.1 1193 Description: Adds a listener function for the event triggered after a variable has been changed.
jhurst 1.1 1194
Aurelie Bertrand 74.1 1195 Example:
jhurst 1.1 1196
1197 (% class="box" %)
1198 (((
Aurelie Bertrand 74.1 1199 ddCtrl.addVariableChangeListener(function(variable, value) { alert("The variable " + variable + " has changed; new value: " + value); });
jhurst 1.1 1200 )))
1201
Aurelie Bertrand 67.1 1202
Aurelie Bertrand 74.1 1203 == Dashboard Event Handling{{id name="event_tdb"/}} ==
jhurst 1.1 1204
crandon 5.1 1205
Aurelie Bertrand 74.1 1206 **void ddCtrl.addDashboardLoadListener (Function)**
crandon 5.1 1207
Aurelie Bertrand 74.1 1208 Description: Adds a listener for the event triggered once the dashboard has loaded but has not yet been rendered.
crandon 5.1 1209
Aurelie Bertrand 74.1 1210 Example:
crandon 5.1 1211
1212 (% class="box" %)
1213 (((
Aurelie Bertrand 74.1 1214 ddCtrl.addDashboardLoadListener(function(currentPage) { alert("Initialising the dashboard"); });
crandon 5.1 1215 )))
1216
1217
1218
Aurelie Bertrand 74.1 1219 **void ddCtrl.addCurrentPageLoadListener (Function)**
jhurst 1.1 1220
Aurelie Bertrand 74.1 1221 Description: Adds a function to listen for the event triggered once the dashboard page has fully loaded.
jhurst 1.1 1222
Aurelie Bertrand 74.1 1223 Example:
jhurst 1.1 1224
1225 (% class="box" %)
1226 (((
Aurelie Bertrand 74.1 1227 ddCtrl.addCurrentPageLoadListener(function(currentPage) { alert("Page " + currentPage + " has been loaded"); });
jhurst 1.1 1228 )))
1229
1230
Aurelie Bertrand 74.1 1231 **void ddCtrl.addCurrentPageChangeListener (Function)**
jhurst 1.1 1232
Aurelie Bertrand 74.1 1233 Description: Adds a function to listen for the event triggered when a page changes.
jhurst 1.1 1234
Aurelie Bertrand 74.1 1235 Example:
jhurst 1.1 1236
1237 (% class="box" %)
1238 (((
Aurelie Bertrand 74.1 1239 ddCtrl.addCurrentPageChangeListener(function(currentPage, bFirstTime) { alert("The page is now " + currentPage); });
jhurst 1.1 1240 )))
1241
1242
Aurelie Bertrand 74.1 1243 **void ddCtrl.addUserLoggedListener (Function)**
jhurst 1.1 1244
Aurelie Bertrand 74.1 1245 Description: Event triggered once the user has been authenticated. May be useful when using the ddCtrl.getUserAttribute function.
jhurst 1.1 1246
Aurelie Bertrand 74.1 1247 Example:
jhurst 1.1 1248
1249 (% class="box" %)
1250 (((
Aurelie Bertrand 74.1 1251 ddCtrl.addUserLoggedListener(function() { alert("You are logged in"); });
jhurst 1.1 1252 )))
1253
1254
Aurelie Bertrand 74.1 1255 **void ddCtrl.addPortletHiddenListener (Function)**
jhurst 1.1 1256
Aurelie Bertrand 74.1 1257 Description: Event triggered when the object’s status changes from visible to hidden.
jhurst 1.1 1258
Aurelie Bertrand 74.1 1259 Example:
jhurst 1.1 1260
1261 (% class="box" %)
1262 (((
Aurelie Bertrand 74.1 1263 ddCtrl.addPortletHiddenListener(function(portletId) { alert("The object is hidden"); });
jhurst 1.1 1264 )))
1265
1266
Aurelie Bertrand 74.1 1267 **void ddCtrl.addPortletVisibleListener (Function)**
jhurst 1.1 1268
Aurelie Bertrand 74.1 1269 Description: Event triggered when the object’s status changes from hidden to visible.
jhurst 1.1 1270
Aurelie Bertrand 74.1 1271 Example:
jhurst 1.1 1272
1273 (% class="box" %)
1274 (((
Aurelie Bertrand 74.1 1275 ddCtrl.addPortletVisibleListener(function(portletId) { alert("The object is visible"); });
jhurst 1.1 1276 )))
1277
1278
Aurelie Bertrand 74.1 1279 **void ddCtrl.addPortletCollapseListener (Function)**
jhurst 1.1 1280
Aurelie Bertrand 74.1 1281 Description: Event triggered when the user clicks the icon to hide a retractable element.
jhurst 1.1 1282
Aurelie Bertrand 74.1 1283 Example:
jhurst 1.1 1284
1285 (% class="box" %)
1286 (((
Aurelie Bertrand 74.1 1287 ddCtrl.addPortletCollapseListener(function(portletId) { alert("The object is about to be hidden"); });
jhurst 1.1 1288 )))
1289
1290
Aurelie Bertrand 74.1 1291 **void ddCtrl.addPortletCollapsedListener (Function)**
jhurst 1.1 1292
Aurelie Bertrand 74.1 1293 Description: Event triggered once the retractable element has been hidden.
jhurst 1.1 1294
Aurelie Bertrand 74.1 1295 Example:
jhurst 1.1 1296
1297 (% class="box" %)
1298 (((
Aurelie Bertrand 74.1 1299 ddCtrl.addPortletCollapsedListener(function(portletId) { alert("The object is hidden"); });
jhurst 1.1 1300 )))
1301
1302
Aurelie Bertrand 74.1 1303 **void ddCtrl.addPortletExpandListener (Function)**
jhurst 1.1 1304
Aurelie Bertrand 74.1 1305 Description: Event triggered when the user clicks the icon to expand a retractable element.
jhurst 1.1 1306
Aurelie Bertrand 74.1 1307 Example:
jhurst 1.1 1308
1309 (% class="box" %)
1310 (((
Aurelie Bertrand 74.1 1311 ddCtrl.addPortletExpandListener(function(portletId) { alert("The object is about to be displayed"); });
jhurst 1.1 1312 )))
1313
1314
Aurelie Bertrand 74.1 1315 **void ddCtrl.addPortletExpandedListener (Function)**
jhurst 1.1 1316
Aurelie Bertrand 74.1 1317 Description: Event triggered once the retractable element has been displayed.
jhurst 1.1 1318
Aurelie Bertrand 74.1 1319 Example:
jhurst 1.1 1320
1321 (% class="box" %)
1322 (((
Aurelie Bertrand 74.1 1323 ddCtrl.addPortletExpandedListener(function(portletId) { alert("The object is displayed"); });
jhurst 1.1 1324 )))
1325
1326
Aurelie Bertrand 74.1 1327 **void ddCtrl.addGroupOfTabsChangeListener (Function)**
jhurst 1.1 1328
Aurelie Bertrand 74.1 1329 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 1330
Aurelie Bertrand 74.1 1331 Example:
jhurst 1.1 1332
1333 (% class="box" %)
1334 (((
Aurelie Bertrand 74.1 1335 ddCtrl.addGroupOfTabsChangeListener(function(portletTabId, curPortletId) { alert("The current portlet is: " + curPortletId); });
jhurst 1.1 1336 )))
1337
1338
Aurelie Bertrand 74.1 1339 **void ddCtrl.addDocumentUploadListener (Function)**
jhurst 1.1 1340
Aurelie Bertrand 74.1 1341 Description: event triggered when the user adds a file via the dashboard.
jhurst 1.1 1342
Aurelie Bertrand 74.1 1343 Example:
jhurst 1.1 1344
1345 (% class="box" %)
1346 (((
Aurelie Bertrand 74.1 1347 ddCtrl.addDocumentUploadListener(function(serverName, filesName) { alert("The file " + filesName[0] + " has been successfully added"); });
jhurst 1.1 1348 )))
1349
Aurelie Bertrand 68.1 1350
Aurelie Bertrand 74.1 1351 **void ddCtrl.addScalingZoomListener(function(zoomConfig){}) (Function){{id name="event_scale"/}}**
Aurelie Bertrand 68.1 1352
Aurelie Bertrand 74.1 1353 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 1354
Aurelie Bertrand 74.1 1355 Example:
Aurelie Bertrand 68.1 1356
1357 (% class="box" %)
1358 (((
1359 ddCtrl.addScalingZoomListener(function(zoomConfig){
Aurelie Bertrand 74.1 1360 console.log("The zoom level has been changed: " + JSON.stringify(zoomConfig));
Aurelie Bertrand 68.1 1361 });
1362 )))
1363
Aurelie Bertrand 74.1 1364 = Miscellaneous functions =
jhurst 1.1 1365
Aurelie Bertrand 74.1 1366 **(String array) ddCtrl.getUserRoles ()**
jhurst 1.1 1367
Aurelie Bertrand 74.1 1368 Description: Returns the list of role IDs for the logged-in user.
jhurst 1.1 1369
1370
Aurelie Bertrand 74.1 1371 **(Associative array of strings / booleans) ddCtrl.getUserACLs ()**
jhurst 1.1 1372
Aurelie Bertrand 74.1 1373 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.
jhurst 1.1 1374
Aurelie Bertrand 74.1 1375 Example:
jhurst 1.1 1376
1377 (% class="box" %)
1378 (((
Aurelie Bertrand 74.1 1379 if (ddCtrl.getUserACLs()['SaveAsPPT']) alert("You can save as PPT");
jhurst 1.1 1380 )))
1381
Aurelie Bertrand 74.1 1382 List of all possible authorizations:
jhurst 1.1 1383
Aurelie Bertrand 74.1 1384 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 1385
1386
Aurelie Bertrand 74.1 1387 **(String) ddCtrl.getUserAttribute (attr)**
jhurst 1.1 1388
Aurelie Bertrand 74.1 1389 Description: Returns the user’s LDAP attribute <attr>.
jhurst 1.1 1390
1391
Aurelie Bertrand 74.1 1392 **(String) ddCtrl.getUserAttribute (attr, Function)**
jhurst 1.1 1393
Aurelie Bertrand 74.1 1394 Description: Returns the user’s LDAP attribute <attr> via an asynchronous call function.
jhurst 1.1 1395
Aurelie Bertrand 74.1 1396 Example:
jhurst 1.1 1397
1398 (% class="box" %)
1399 (((
1400 ddCtrl.getUserAttribute('displayName', function (attrVal) {alert(attrVal)});
1401 )))
1402
1403
Aurelie Bertrand 74.1 1404 **(String) ddCtrl.getSessionAttribute (attr)**
jhurst 1.1 1405
Aurelie Bertrand 74.1 1406 Description: Returns the <attr> attribute of the user’s session.
jhurst 1.1 1407
Aurelie Bertrand 74.1 1408 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1409
1410
Aurelie Bertrand 74.1 1411 **(String) ddCtrl.getSessionAttribute (attr, Function)**
jhurst 1.1 1412
Aurelie Bertrand 74.1 1413 Description: Returns the <attr> attribute of the user session via an asynchronous callback function.
jhurst 1.1 1414
Aurelie Bertrand 74.1 1415 Example:
jhurst 1.1 1416
1417 (% class="box" %)
1418 (((
Aurelie Bertrand 74.1 1419 ddCtrl.getSessionAttribute('regionSelected', function (attrVal) {alert(attrVal)});
jhurst 1.1 1420 )))
1421
Aurelie Bertrand 74.1 1422 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1423
1424
Aurelie Bertrand 74.1 1425 **void ddCtrl.setSessionAttribute (attr, value)**
jhurst 1.1 1426
Aurelie Bertrand 74.1 1427 Description: Updates the <attr> attribute of the user session with the specified value.
jhurst 1.1 1428
Aurelie Bertrand 74.1 1429 Example:
jhurst 1.1 1430
1431 (% class="box" %)
1432 (((
Aurelie Bertrand 74.1 1433 ddCtrl.setSessionAttribute('regionSelected', ‘France’);
jhurst 1.1 1434 )))
1435
Aurelie Bertrand 74.1 1436 See the [[Session Variables Tutorial>>doc:Digdash.user_guide.tutorials.session_variables_tutorial.WebHome]] for more information on session variables.
jhurst 1.1 1437
1438
Aurelie Bertrand 74.1 1439 **(String) ddCtrl.getServerAttribute (attr)**
jhurst 1.1 1440
Aurelie Bertrand 74.1 1441 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 1442
Aurelie Bertrand 74.1 1443 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
jhurst 1.1 1444
1445
Aurelie Bertrand 74.1 1446 **(String) ddCtrl.getServerAttribute (attr, Function)**
jhurst 1.1 1447
Aurelie Bertrand 74.1 1448 Description: Returns the <attr> server attribute via an asynchronous call.
jhurst 1.1 1449
Aurelie Bertrand 74.1 1450 Example:
jhurst 1.1 1451
1452 (% class="box" %)
1453 (((
1454 ddCtrl.getSessionAttribute('serverMode', function (attrVal) {alert(attrVal)});
1455 )))
1456
Aurelie Bertrand 74.1 1457 See the [[Advanced System Settings>>doc:Digdash.deployment.configuration.advanced_system_guide.WebHome]] for more information on server variables.
jhurst 1.1 1458
1459
Aurelie Bertrand 74.1 1460 **(String) ddCtrl.getUserStorage (attr)**
crandon 5.1 1461
Aurelie Bertrand 74.1 1462 Description: Returns the <attr> attribute of the specified user that was previously saved.
crandon 5.1 1463
Aurelie Bertrand 74.1 1464 Example:
crandon 5.1 1465
1466 (% class="box" %)
1467 (((
Aurelie Bertrand 74.1 1468 var value = ddCtrl.getUserStorage('attribute');
crandon 5.1 1469 )))
1470
Aurelie Bertrand 74.1 1471 **void ddCtrl.setUserStorage (attr, value)**
crandon 5.1 1472
Aurelie Bertrand 74.1 1473 Description: Saves the user’s <attr> attribute persistently on the server for future use.
crandon 5.1 1474
Aurelie Bertrand 74.1 1475 Example:
crandon 5.1 1476
1477 (% class="box" %)
1478 (((
Aurelie Bertrand 74.1 1479 ddCtrl.setUserStorage('attribute', 'value');
crandon 5.1 1480 )))
1481
1482
Aurelie Bertrand 74.1 1483 **void ddCtrl.fireRefreshEvent (event)**
crandon 5.1 1484
Aurelie Bertrand 74.1 1485 Description: Triggers a server-side refresh of the data associated with the specified event
crandon 6.1 1486
Aurelie Bertrand 74.1 1487 Example:
crandon 6.1 1488
1489 (% class="box" %)
1490 (((
Aurelie Bertrand 74.1 1491 ddCtrl.fireRefreshEvent('DAILY_UPDATE');
crandon 6.1 1492 )))
1493
1494
Aurelie Bertrand 74.1 1495 **void ddCtrl.newAuthToken ()**
crandon 8.1 1496
Aurelie Bertrand 74.1 1497 Description: Returns an authentication token generated for the current session.
crandon 8.1 1498
Aurelie Bertrand 74.1 1499 Example:
crandon 8.1 1500
1501 (% class="box" %)
1502 (((
1503 var token = ddCtrl.newAuthToken();
1504
Aurelie Bertrand 27.1 1505 window.open("http:~/~/localhost:8080/digdash_dashboard/index.html?user=mon_user&authToken=token");
crandon 8.1 1506 )))
1507
1508
Aurelie Bertrand 74.1 1509 **void loadCSS(cssFile)**
jhurst 1.1 1510
Aurelie Bertrand 74.1 1511 Description: Loads a CSS file.
jhurst 1.1 1512
1513
1514 **void ddCtrl.loadTheme (cssTheme)**
1515
Aurelie Bertrand 74.1 1516 Description: Loads a DigDash CSS theme onto the dashboard.
jhurst 1.1 1517
Aurelie Bertrand 74.1 1518 Example:
jhurst 1.1 1519
1520 (% class="box" %)
1521 (((
1522 ddCtrl.loadTheme(‘digdash’);
1523 )))
1524
crandon 6.1 1525 **void ddCtrl.removeTheme (cssTheme)**
jhurst 1.1 1526
Aurelie Bertrand 74.1 1527 Description: Removes the DigDash CSS theme from the dashboard.
crandon 6.1 1528
Aurelie Bertrand 74.1 1529 Example:
crandon 6.1 1530
1531 (% class="box" %)
1532 (((
Aurelie Bertrand 74.1 1533 ddCtrl.removeTheme('digdash');
crandon 6.1 1534 )))
1535
Aurelie Bertrand 74.1 1536 **void openFormInWindow (portlet, width, height, dimension, member [, dimension, member, ...])**
crandon 9.1 1537
Aurelie Bertrand 74.1 1538 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 1539
Aurelie Bertrand 74.1 1540 Example:
crandon 9.1 1541
1542 (% class="box" %)
1543 (((
Aurelie Bertrand 74.1 1544 <a href="javascript:__ddCtrl.openFormInWindow__('portletId', '80%', '80%', 'Year', '2024', 'Country', 'France')">Displays the form with the values ‘France 2024’</a>
crandon 9.1 1545 )))
1546
abertrand 12.1 1547
Aurelie Bertrand 74.1 1548 **void initFormData (portlet, field name, field value [, name, value, ...])**
crandon 9.1 1549
Aurelie Bertrand 74.1 1550 Description: Initialises a form with the values specified as parameters (a list of key-value pairs for the form fields).
crandon 9.1 1551
Aurelie Bertrand 74.1 1552 Example:
crandon 9.1 1553
1554 (% class="box" %)
1555 (((
Aurelie Bertrand 74.1 1556 <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 1557 )))
1558
Aurelie Bertrand 74.1 1559 * To retrieve the portlet ID, open the portlet’s **Information** tab in the Dashboard Editor and copy **the Unique ID**.
1560 * 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 1561
jhurst 1.1 1562 **void logout ()**
1563
Aurelie Bertrand 74.1 1564 Description: Logs out the current user.