Members
EventData :Object
Context object passed to events and hook functions.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
tree |
Fancytree | The tree instance |
widget |
object | |
options |
FancytreeOptions | Shortcut to tree.options |
originalEvent |
Event | The jQuery Event that initially triggered this call |
node |
FancytreeNode | null | The node that this call applies to ( |
result |
any | (output parameter) Event handlers can return values back to the caller. Used by |
targetType |
string | undefined | (only for click and dblclick events) 'title' | 'prefix' | 'expander' | 'checkbox' | 'icon' |
typeInfo |
object | Contains |
response |
any | (only for postProcess event) Original ajax response |
- Source:
FancytreeEvents :Object
Events are called like this:
CALLBACK_NAME(event, data)
where event
is a jQuery Event
object and data
is of type EventData.
The this
context is set to the tree's HTMLDivElement.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
activate |
function |
|
beforeActivate |
function |
|
beforeExpand |
function |
|
beforeRestore |
function | ext-persist is about to restore the previous state. Return |
beforeSelect |
function |
|
beforeUpdateViewport |
function | ext-grid is about to redraw the tree.viewport. |
blur |
function |
|
blurTree |
function |
|
click |
function |
|
clickPaging |
function |
|
collapse |
function |
|
create |
function | Widget was created. |
createNode |
function | Allow tweaking and binding, after node was created for the first time (NOTE: this event is only available as callback, but not for bind()) |
dblclick |
function |
|
deactivate |
function |
|
defaultGridAction |
function | (used by ext-aria) The user hit enter on the active row or cell. |
enhanceTitle |
function | Allow extending the |
expand |
function |
|
focus |
function |
|
focusTree |
function |
|
|
function | @deprecated use tree option |
init |
function | Widget was (re-)initialized. |
keydown |
function |
|
keypress |
function | (currently unused) |
lazyLoad |
function |
|
loadChildren |
function | Node data was loaded, i.e. |
loadError |
function | A load error occurred. Return |
modifyChild |
function | A child of |
postProcess |
function | Allows to modify the ajax response |
preInit |
function | Widget markup was created, but no data loaded yet. |
|
function | @deprecated use |
renderColumns |
function | (used by table extension) |
renderStatusColumns |
function | (used by table extension) |
renderNode |
function | Allow tweaking after node state was rendered (NOTE: this event is only available as callback, but not for bind()) |
renderTitle |
function | Allow replacing the |
restore |
function | ext-persist has expanded, selected, and activated the previous state |
select |
function |
|
updateViewport |
function | ext-grid has redrawn the tree.viewport. |
- Source:
- See:
-
- jQuery Event
- EventData
- init
Example
$("#tree").fancytree({
activate: function(event, data){
var node = data.node;
}
});
FancytreeOptions :Object
Fancytree options (see also example)
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
activeVisible |
boolean | Make sure that the active node is always visible, i.e. its parents are expanded (default: true). |
ajax |
object | Default options for ajax requests |
aria |
boolean | (default: true) Add WAI-ARIA attributes to markup |
autoActivate |
boolean | Activate a node when focused with the keyboard (default: true) |
autoCollapse |
boolean | Automatically collapse all siblings, when a node is expanded (default: false). |
autoScroll |
boolean | Scroll node into visible area, when focused by keyboard (default: false). |
checkbox |
boolean | string | function | Display checkboxes to allow selection (default: false). |
checkboxAutoHide |
boolean | Hide checkboxes unless selected or hovered. |
clickFolderMode |
Integer | Defines what happens, when the user click a folder node. |
columns |
object | array | Made available as |
copyFunctionsToData |
boolean | Copy also functions to the node's data property (default: false) |
debugLevel |
Integer | 0..4 (null: use global setting $.ui.fancytree.debugLevel) |
defaultKey |
function | callback(node) is called for new nodes without a key. Must return a new unique key. (default null: generates default keys like that: "_" + counter) |
|
boolean | Accept passing ajax data in a property named |
escapeTitles |
boolean | Make sure all HTML tags are escaped (default: false). |
extensions |
Array.<string> | List of active extensions (default: []) |
focusOnSelect |
boolean | Set focus when node is checked by a mouse click (default: false) |
generateIds |
boolean | Add |
icon |
boolean | function | Display node icons (default: true) |
|
boolean | @deprecated use |
iconTooltip |
boolean | function | Add a |
idPrefix |
string | prefix used to generate node markup ID attributes (default: "ft_", requires generateIds to be set) |
imagePath |
string | Path to a folder containing icons (default: null, using 'skin/' subdirectory). |
keyboard |
boolean | Support keyboard navigation (default: true). |
keyPathSeparator |
string | (default: "/") |
minExpandLevel |
Integer | 2: top-level nodes are not collapsible (default: 1) |
nodata |
boolean | string | function | Display a special message when the tree loader |
quicksearch |
boolean | navigate to next node by typing the first letters (default: false) |
scrollOfs |
object | optional margins for node.scrollIntoView() (default: {top: 0, bottom: 0}) |
scrollParent |
jQuery | scrollable container for node.scrollIntoView() (default: $container) |
selectMode |
Integer | 1:single, 2:multi, 3:multi-hier (default: 2) |
source |
any | Used to Initialize the tree. |
strings |
object | Translation table |
|
boolean | @deprecated use |
tabindex |
string | Add tabindex attribute to container, so tree can be reached using TAB (default: "0") |
titlesTabbable |
boolean | Add tabindex='0' to node title span, so it can receive keyboard focus |
toggleEffect |
object | Animation options, false:off |
tooltip |
boolean | function | Add a |
treeId |
string | optional fixed tree id and namespace (default: null) |
types |
object | Made available as |
unselectable |
boolean | function | (dynamic option) |
unselectableIgnore |
boolean | function | (dynamic option) |
unselectableStatus |
boolean | function | (dynamic option) |
- Since:
- 2.27
- Deprecated:
- Call `data.result = data.response.d` in the `postProcess`event instead
- Source:
Example
$("#tree").fancytree({ source: { url: "/myService" } });
NodeData :Object
Data object passed to FancytreeNode() constructor.
Note: typically these attributes are accessed by class methods, e.g. node.isExpanded()
and node.setTitle("foo")
.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
active |
boolean | Evaluated during initialization: If true, |
checkbox |
boolean | string | Pass |
children |
Array.<NodeData> | Optional array of child nodes. |
data |
object | All unknown properties from constructor will be copied to |
expanded |
boolean | Initial expansion state. Use |
extraClasses |
string | Class names added to the node markup (separate with space). |
focus |
boolean | (Initialization only, but will not be stored with the node.) |
folder |
boolean | Folders have different default icons and honor the |
|
boolean | @deprecated use |
icon |
boolean | string | Define this node's icon. |
|
string | @deprecated use |
iconTooltip |
string | Will be added as |
key |
string | Unique key for this node (auto-generated if omitted). |
lazy |
boolean | Lazy folders call the |
refKey |
string | (Reserved, used by 'clones' extension.) |
selected |
boolean | Initial selection state. Use |
statusNodeType |
string | If set, make this node a status node. Values: 'error', 'loading', 'nodata', 'paging'. |
title |
string | Node text (may contain HTML tags). Use |
tooltip |
string | Will be added as |
type |
string | Made available as |
unselectable |
boolean | Prevent (de-)selection using mouse or keyboard. |
unselectableIgnore |
boolean | Ignore this node when calculating the |
unselectableStatus |
boolean | Use this as constant |
OTHER |
any | Attributes other than listed above will be copied to |
- Since:
- 2.23
- Source:
NodePatch :Object
Data object similar to NodeData, but with additional options.
May be passed to FancytreeNode#applyPatch
(Every property that is omitted (or set to undefined) will be ignored)
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
any |
any | (see NodeData) |
appendChildren |
NodeData | (not yet implemented) |
replaceChildren |
NodeData | (not yet implemented) |
insertChildren |
NodeData | (not yet implemented) |
- Source:
TreePatch :Object
List of [key, NodePatch] tuples.
May be passed to Fancytree#applyPatch.
Type:
- Object
- Source: