Handle selection changes on the competency tree.
- Source:
- Copyright:
- 2015 Damyon Wiese
- 2015 Damyon Wiese
- License:
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Members
(inner) competencies :Array.<Object>
Cached list of competencies
Type:
- Array.<Object>
(inner) competencyFrameworkId :Number
The current framework id
Type:
- Number
(inner) competencyFrameworkShortName :String
The current framework short name
Type:
- String
(inner) competencyFramworkCanManage :Boolean
Can manage the competencies framework
Type:
- Boolean
(inner) currentNodeId :String
The data-id of the current node in the tree.
Type:
- String
(inner) treeSelector :String
The selector for the root of the tree.
Type:
- String
Methods
(static) getCompetency(id) → {Object}
Get a competency by id
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency id |
Returns:
- Type
- Object
(static) getCompetencyFrameworkId() → {Number}
Get the competency framework id this model was initiliased with.
Returns:
- Type
- Number
(static) getCompetencyLevel(id) → {Number}
Get the competency level.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency ID. |
Returns:
- Type
- Number
(static) hasRule(id) → {Boolean}
Does the competency have a rule?
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency ID. |
Returns:
- Type
- Boolean
(static) init(id, shortname, search, selector, canmanage, competencyid)
Initialise the tree.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency framework id. |
shortname |
String | The framework shortname |
search |
String | The current search string |
selector |
String | The selector for the tree div |
canmanage |
Boolean | Can manage the competencies |
competencyid |
Number | The id of the competency to show first |
(static) listCompetencies() → {Array.<Object>}
Get all competencies for this framework.
Returns:
- Type
- Array.<Object>
(static) on(eventname, handler)
Add an event handler for custom events emitted by the tree.
Parameters:
Name | Type | Description |
---|---|---|
eventname |
String | The name of the event - only "selectionchanged" for now |
handler |
function | The handler for the event. |
(inner) getChildren(id) → {Array}
Get the children of a competency.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency ID. |
Returns:
- Type
- Array
(inner) hasChildren(id) → {Boolean}
Whether a competency has children.
Parameters:
Name | Type | Description |
---|---|---|
id |
Number | The competency ID. |
Returns:
- Type
- Boolean
(inner) reloadCompetencies() → {Promise}
Reload all the page competencies framework competencies.
Returns:
- Type
- Promise