Files

Manage files for use with components of flows.

Configuration

Set up a new instance with config parameters and set/get methods:

const files = appmixer.ui.Files(config)

files.set(key, value)
files.get(key)

config.el ...

Learn about widget config here.

Instance

Learn about widget instance here.

State

files.state(name, value)

loader

Type: Boolean | Default: null

Toggle a custom loading state.

error

Type: String | Default: null

Toggle a custom error message. query

Type: Object | Default: DefaultQuery

Defines custom query parameters for retrieving files. Example:

// Set a custom query.
files.state('query', {
    pattern: 'my custom pattern',
    sort: { uploadDate: -1 }
});

// Listen for query changes triggered by user interaction.
files.on('change:query', query => {
    console.log('Current query:', query);
});

Events

files.on(event, handler)

flow:open

files.on('flow:open', flowId => {/* ... */})

Triggered when the user selects a flow associated with a file listed in the widget.

Example

const files = appmixer.ui.Files({
    el: '#files'
})

files.open()

Last updated

Was this helpful?