This is a helper method and is equivalent to looping
through all of the objects in a dashboard and collecting all of the objects
whose type is worksheet
. You can use this property to iterate
through all of the worksheets in the dashboard.
Adds a new event listener to the object. If this object does not support the specified eventType
,
the method throws an exception.
The following table shows the event types supported by objects.
object | eventType |
---|---|
Worksheet | FilterChanged , MarkSelectionChanged , SummaryDataChanged |
Parameter | ParameterChanged |
Settings | SettingsChanged |
Dashboard | DashboardLayoutChanged , WorkbookFormattingChanged |
The type of event to register for. The type of event is a TableauEventType
enumeration.
The function which will be called when an event happens.
A helper function which can be called to remove this registration.
The following example sets up a listener in a worksheet for a mark selection event (MarkSelectionChanged
).
When the event occurs, the data is reloaded. The addEventListener
method returns a function that un-registers
the event handler. Call that function, in this case, unregisterEventHandlerFunction()
to remove the registration.
// Add an event listener for the selection changed event on this sheet.
// Assigning the event to a variable just to make the example fit on the page here.
const markSelection = tableau.TableauEventType.MarkSelectionChanged;
//
unregisterEventHandlerFunction = worksheet.addEventListener(markSelection, function (selectionEvent) {
// When the selection changes, reload the data
loadSelectedMarks(worksheetName);
});
// remove the event listener when done
unregisterEventHandlerFunction();
Applies a simple categorical filter (non-date) to the dashboard. This method is similar to the method used for worksheets, but applies the filter to all the worksheets in the dashboard that have that same field. Note that the filter is ignored by a worksheet if the worksheet doesn't have the relevant field in its data source.
The name of the field to filter on.
The list of values to filter on.
The update type of this filter (add, all, remove, replace).
Advanced filter options (isExcludeMode).
The field name that the filter is applied on.
Searches for a parameter with the given name.
The name of the parameter to find.
The parameter with the given name, or undefined if it does not exist.
Gets the specified dashboard object by its id. If a dashboard object is not found this method returns undefined.
The id of an object on the dashboard.
The dashboard object with that id. Returns undefined if the dashboard object is not found.
The collection of filters used on the dashboard
A collection of all the Tableau parameters that are used in this workbook.
Sets the position and size of one or more floating dashboard objects. Throws an error if the dashboard object is invalid
Empty promise that resolves when the position and size of the dashboard objects have been changed.
Removes an event listener if a matching one is found. If no matching listener exists, the method does nothing.
The handler function must the handler function specified in the call to the addEventListener
method. Alternatively, use the function
returned from the call to addEventListener
to unregister the event listener.
For more information, see Events and Event Handling.
Whether or not an event listener was removed.
Replays an animation for the active sheet Throws an error if the replay speed is invalid
Empty promise that resolves when the animation has been replayed.
Sets the visibility of one or more dashboard objects. Throws an error if the dashboard object is invalid
A map of dashboard object ids to its desired state of visibility.
Empty promise that resolves when the visibility has been changed.
Sets the visibility of one or more floating dashboard zones. Throws an error if the zone is invalid
A map of zone ids to the desired state of visibility for that zone.
Empty promise that resolves when the visibility has been changed.
The
Dashboard
interface inherits from theSheet
interface.