Competency picker.
To handle 'save' events use: picker.on('save') This will receive a object with either a single 'competencyId', or an array in 'competencyIds' depending on the value of multiSelect.
- Source:
- Copyright:
- 2015 Frédéric Massart - FMCorz.net
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Methods
(inner) _afterRender()
Hook to executed after the view is rendered.
(inner) _fetchCompetencies(frameworkId, searchText) → {Promise}
Fetch the competencies.
Parameters:
Name | Type | Description |
---|---|---|
frameworkId |
Number | The frameworkId. |
searchText |
String | Limit the competencies to those matching the text. |
Returns:
- Type
- Promise
(inner) _find(selector) → {JQuery}
Find a node in the dialogue.
Parameters:
Name | Type | Description |
---|---|---|
selector |
String |
Returns:
- Type
- JQuery
(inner) _getFramework(fid) → {Object}
Convenience method to get a framework object.
Parameters:
Name | Type | Description |
---|---|---|
fid |
Number | The framework ID. |
Returns:
- Type
- Object
(inner) _loadCompetencies() → {Promise}
Load the competencies.
Returns:
- Type
- Promise
(inner) _loadFrameworks() → {Promise}
Load the frameworks.
Returns:
- Type
- Promise
(inner) _preRender() → {Promise}
Hook to executed before render.
Returns:
- Type
- Promise
(inner) _refresh() → {Promise}
Refresh the view.
Returns:
- Type
- Promise
(inner) _render() → {Promise}
Render the dialogue.
Returns:
- Type
- Promise
(inner) _reset()
Reset the dialogue properties.
This does not reset everything, just enough to reset the UI.
(inner) _reset(type, data)
Trigger an event.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The type of event. |
data |
Object | The data to pass to the listeners. |
(inner) _setDisallowedCompetencyIDs(ids)
Set what competencies cannot be picked.
This needs to be set after reset/close.
Parameters:
Name | Type | Description |
---|---|---|
ids |
Array.<Number> | The IDs. |
(inner) close()
Close the dialogue.
(inner) display() → {Promise}
Opens the picker.
Returns:
- Type
- Promise
(inner) on(type, handler)
Register an event listener.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | The event type. |
handler |
function | The event listener. |