Launch a Checklist
Launches a Checklist widget by its ID. If another Checklist is shown already, this will replace it with the specified one.
Type Definition
type launchChecklist = (
checklistId: number,
options?: {
itemsShown?: boolean
}
) => void
Optional parameters:
itemsShown(boolean) – Whether the checklist’s items should be immediately shown (expanded) when launched. The default is false (by default, launching a checklist will display only the checklist launcher icon or minimized widget).
Examples
Triggers a Checklist with default options
userGuiding.launchChecklist(1234)
Trigger a Checklist expanded
userGuiding.launchChecklist(1234, {
itemsShown:true
})
Expand the Checklist
Expands the content area of an active (launched) Checklist widget. If the checklist is currently collapsed/minimized, this will open it to show all checklist items.
Type Definition
type expandChecklist = () => void
Example:
If active checklist is collapsed, expands it to show its items
userGuiding.expandChecklist();
Collapse the Checklist
Collapses the content area of an active Checklist widget. This hides the checklist’s items, leaving just the checklist launcher visible.
Type Definition
type collapseChecklist = () => void
Example:
Collapses the checklist if it's open
userGuiding.collapseChecklist();
Hide the Checklist
Closes/hides the currently active Checklist and the launcher from the page.
Type Definition
type hideChecklist = () => void
Example:
Hides any active checklist
userGuiding.hideChecklist();
Get Checklist Completion Info
Returns the completion status of all checklists for the current user. This method provides an array of checklist info objects, each containing the checklist’s ID, and lists of its item IDs that are completed or incomplete.
Type Definition
type getChecklistCompletionInfo = () => {
id: number
items: string[]
completedItems: string[]
incompleteItems: string[]
}[]
Example:
userGuiding.getCheklistCompletionInfo()
Output:
[
{
id: 11719,
items: [
"82ef304a-63a1-4ff4-aacb-4f656420b478"
],
completedItems: [],
incompleteItems: [
"82ef304a-63a1-4ff4-aacb-4f656420b478"
]
},
{
id: 11715,
items: [],
completedItems: [],
incompleteItems: []
}
]