Jump to: navigation, search
(Update with the copy of version: 8.5.0)
(Automated save: adding PEC_Migrated template.)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
= API Commands =
 
= API Commands =
  
Once you've registered your own plugin on the bus, you can call commands on other registered plugins. Below we'll quickly register a new plugin on the bus using the global bus object.
+
{{Template:PEC_Migrated}}
  
{{NoteFormat|The global bus object is a debug tool. When implementing Widgets on your own site, do not use the global bus object to register your custom plugins. Instead, see [[GWCBusExtensions|Widgets Extensions]] for more information about extending Genesys Widgets.|1}}
 
  
  
<source lang='javascript'>var oMyPlugin = window._genesys.widgets.bus.registerPlugin('MyPlugin');
+
{{NoteFormat|Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/Overlay-combined#API_Commands.}}
 
 
oMyPlugin.command('Overlay.close');</source>
 
 
 
== open ==
 
Opens the provided HTML in an Overlay View. When successful, it returns back the HTML and a custom close event for you to subscribe to. This alerts you when your overlay instance has been closed. You can also make your overlay immutable so that new overlay instances don't close yours. Only your widget can close its overlay when immutable is set to true.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('Overlay.open', {
 
 
 
html: '<div>Template</div>',
 
immutable: false,
 
group: false
 
 
 
}).done(function(e){
 
 
 
// Overlay opens successfully
 
 
 
}).fail(function(e){
 
 
 
// Overlay failed to open
 
});
 
</source>
 
 
 
<br />
 
=== Options ===
 
{|
 
|-
 
! Option
 
! Type
 
! Description
 
|-
 
| html
 
| string
 
| HTML String template for overlay window.
 
|-
 
| immutable
 
| boolean
 
| When set to true, overlay cannot be closed by other plugins.
 
|-
 
| group
 
| string
 
| When set to true, overlay cannot be closed by other plugins.
 
|-
 
|}
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When overlay is successfully opened
 
| {html: <template>, events: <Object>, group: <String>}
 
|-
 
| rejected
 
| When no html template is passed
 
| 'No HTML content was provided. Overlay has ignored your command.'
 
|-
 
| rejected
 
| When overlay is already opened
 
| 'Overlay view is currently reserved.'
 
|-
 
|}
 
== close ==
 
Closes the Overlay UI. Publishes the appropriate custom close event for current overlay being closed.
 
<br /><br />
 
=== Example ===
 
<source lang='javascript'>
 
oMyPlugin.command('Overlay.close').done(function(e){
 
 
 
// Overlay closed successfully
 
 
 
}).fail(function(e){
 
 
 
// Overlay failed to close
 
});
 
</source>
 
 
 
<br />
 
=== Resolutions ===
 
{|
 
|-
 
! Status
 
! When
 
! Returns
 
|-
 
| resolved
 
| When Overlay is successfully closed.
 
| n/a
 
|-
 
| rejected
 
| When Overlay is already closed.
 
| 'Overlay view is already closed'
 
|-
 
| rejected
 
| When Overlay view is immutable.
 
| 'Overlay view is currently reserved'
 
|-
 
|}
 
  
 
[[Category:V:PSAAS:Public]]
 
[[Category:V:PSAAS:Public]]

Latest revision as of 23:04, June 21, 2020

API Commands

Important
This content may not be the latest Genesys Engage cloud content. To find the latest content, go to Genesys Engage cloud for Administrators.



Important
Documentation for this software has moved to a new home. Please update links and bookmarks to content hosted at https://all.docs.genesys.com/WID/Current/SDK/Overlay-combined#API_Commands.
This page was last edited on June 21, 2020, at 23:04.
Comments or questions about this documentation? Contact us for support!