FileUpload

FileUpload

new FileUpload(element, options)

Source:
Parameters:
Name Type Description
element HTMLElement

DOM element for component instantiation and scope

options Object
Properties
Name Type Description
groupSelector String

Selector for file upload form group

buttonSelector String

Selector for file upload button

listSelector String

Selector for list of file names

labelChoose String

Label choose state

labelReplace String

Label replace state

attachChangeListener Boolean

Whether or not to bind change events on toggle

Classes

FileUpload

Members

(static) supportedEvents :Array.<string>

Description:
  • An array of supported events for this component.

Source:

An array of supported events for this component.

Type:
  • Array.<string>

Methods

destroy()

Description:
  • Destroy component.

Source:

handleChange(e)

Source:
Parameters:
Name Type Description
e Event
Fires:

init()

Description:
  • Initialise component.

Source:

on(eventName, callback) → {void}

Description:
  • Register a callback function for a specific event.

Source:
Example
// Registering a callback for the 'onSelection' event
fileUpload.on('onSelection', (event) => {
  console.log('Open event occurred!', event);
});
Parameters:
Name Type Description
eventName string

The name of the event to listen for.

callback function

The callback function to be invoked when the event occurs.

Returns:
Type
void

trigger(eventName, eventData)

Description:
  • Trigger a component event.

Source:
Parameters:
Name Type Description
eventName string

The name of the event to trigger.

eventData any

Data associated with the event.

(static) autoInit(root) → {FileUpload}

Source:
Parameters:
Name Type Description
root HTMLElement

DOM element for component instantiation and scope

Returns:

An instance of FileUpload.

Type
FileUpload

Events

onSelection

Source: