-
Notifications
You must be signed in to change notification settings - Fork 83
Using Input API
Alex Cavazos edited this page Nov 9, 2018
·
16 revisions
The Input API is a framework that allows your plugin to show a full-size view with multiple inputs to get user input data.
buildfire.input.showDialog(options, callback)
Options Object | [Object]
-
placeholder- Will be used as the input's placeholder -
saveText- Will be used to complete the input and go to next step -
attachments- Object specifying which attachments to enable-
imagesObject{ enable: Boolean, multiple: Boolean }
-
Callback Function
(err, data) => { ... }
-
err- If the options are invalid you will receive an error -
data- An object with theresults[]and acancelledproperty that can be true/false. If the input dialog was cancelled, the results array will contain up to where the user reached.- results is an array of the result of each step.
Each result can contain the following properties depending on what was enabled
-
value- Text value the user entered -
images- Array of image urls
data = {
cancelled: false,
results: [
{ value: "...", images: [] }
]
}
Some times you want the user to enter multiple things in order. To do this you can pass multiple option objects in an array.
Example
const steps = [options1, options2, options3];
buildfire.input.showDialog(steps, callback);