Functions
#
open(config, data)
Open a Widget in Flyout. Custom data can be passed to Widget's 'PageLoad' event. Supported Widget SDK version >= 1.2.
Note: The presence of an active loader restricts the availability of other pop-ups.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
object | Flyout type config |
|
type |
String | flyout type (widget) |
|
api_name |
String | api name of the widget (Custom Button type) |
|
data |
Any |
<optional> |
data to be passed as 'PageLoad' event data in Widget |
Example
ZDK.Client.createFlyout('myFlyout', { header: 'Sample Flyout', animation_type: 4 });
ZDK.Client.getFlyout('myFlyout').open({ api_name: 'sample_widget', type: 'widget' }, { data: 'sample data to be passed to the widget' });
#
notify(data, options) → {Any}
Notify Flyout and optionally await a response from the Widget. Moreover, custom data can be listened from widget through 'Notify' event. If options.wait is true, data can be listened through 'NotifyAndWait' event.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Any | data can be listened through Notify / NotifyAndWait event in Widget |
|
options |
Object |
<optional> |
|
wait |
String |
<optional> |
true/false - wait for response from Widget |
Response from Widget's ZDK.Client.sendResponse if options.wait is true
Example
var response = ZDK.Client.getFlyout('myFlyout').notify({data: 'sample data'}, {wait: true});