Skip to main content

refresh

Description

This method can be used inside any workspace. Refresh a workspace

Method(s)

1   declare function refresh(): void;

Basic Usage

SW.Application.Workspace.refresh();

setFilter

Description

This method can be used inside any workspace. Create a new assignment

Method(s)

1  declare function setFilter(filter: string, value: any, 
2 params: {senderId?: string} = {senderId: ""}): void;
ParameterTypeRequiredDefaultsDescription
filterStringtrue
valueAnytrue
senderIdStringfalse""Sender's id

Basic Usage

SW.Application.Workspace.setFilter(filter, 20);

setFilters

Description

This method can be used inside any workspace. Set multiple filters

Method(s)

1  declare function setFilters(filtersWithValues: DashboardFilter[], 
2 params: {senderId?: string} = {senderId: ""}): void;
ParameterTypeRequiredDefaultsDescription
filtersWithValuesDashboardFiltertrueArray of filters
senderIdStringfalse

Basic Usage

SW.Application.Workspace.setFilters([filters], "98226093-09B6-4E12-B9C6-2AEED2963C31");

Example

{
name: "apply",
itemType: "button",
buttonOptions: {
width: 100,
text: "Apply",
onClick: function () {
var from = workspaceContext.get("From").option("value");
var to = workspaceContext.get("To").option("value");
var includeNew = workspaceContext.get("IncludeNew").option("value");
workspaceContext.set("Loading", Date.now());
SW.Application.Workspace.setFilters([{ Name: "From", Value: Date.now() }, { Name: "To", Value: Date.now() }]);
SW.Application.Workspace.setFilters([{ Name: "From", Value: from }, { Name: "To", Value: to }, { Name: "IncludeNew", Value: includeNew }]);
}
}
},

img-box-shadow

img-box-shadow

setPanels

Description

This method can be used inside any workspace. Set workspace's panels

Method(s)

1  declare function setPanels(items: IUpdatedLayoutItems, 
2 options: ILayoutEditOptions): void;
ParameterTypeRequiredDefaultsDescription
itemsIUpdatedLayoutItems[]trueLayout items to be updated. Pass the name or id of the item.
  • x: Moves the panel horizontally
  • y: Moves the panel vertically
  • cols: Sets the number of columns
  • rows: Sets the number of rows
optionsILayoutEditOptionstrueA boolean to set save option to true or false

Basic Usage

SW.Application.Workspace.setPanels({ 
GridName1: { x: 0, y: 0, cols: 10, rows: 10 },
'Grid Name 2': { x: 10, y: 2, cols: 10, rows: 10 }
})

getParameter

Description

Retrieves the value of a specified parameter from the workspace.

Method(s)

1  declare function getParameter(name: string): any;
ParameterTypeRequiredDefaultsDescription
namestring[]trueThe name of the parameter to fetch the value from.

Basic Usage

SW.Application.Workspace.getParameter('parameterName')