aciTree API v4.5.0-rc.3
Please note: here are listed only the public API methods, you need to
read about the available init options, the item data
object and his properties and how to listen for the aciTree events before you’ll be able to use aciTree.
Try out the demos to understand how to use the API.
.addCheckbox – Adds a checkbox element to the item…
.addIcon – Adds/updates the ICON image for item…
.addRadio – Adds a radio-button element to the item…
.after – Add a new item or a list of items after item…
.ajaxLoad – Loads a node with AJAX (if not already loaded)…
.append – Add one or more childrens to item, the new items are added at the end…
.asChild – Moves item so it becomes children of a parent item…
.before – Add a new item or a list of items before item…
.blur – Remove focus from the item.
Notifies…
.branch – Run a callback function for every children of item…
.check – Set a checkbox or radio-button in the checked state…
.checkboxes – Filter items and return only the items with a checkbox…
.children – Returns a list of childrens from item.
.close – Closes the item node and all his childrens (if requested)…
.closeOthers – Closes all other nodes less the item…
.columnIndex – Returns the column index for a value of props…
.columns – Returns the column count.
.deselect – Deselects the item.
Notifies with the…
.destroy – Destroys the treeview control, .isLocked will return TRUE from the start until…
.disable – Disable the item node.
Notifies with…
.disabled – Filter items and return only the disabled items…
.edit – Enters the editable mode.
Notifies…
.edited – Returns the edited LI element.
.enable – Enable the item node.
Notifies with…
.enabled – Filter items and return only the enabled items…
.endEdit – Exits the editable mode (optionally saving the changes)…
.filter – Search & filter the tree items starting from item…
.first – Returns the first children of item.
Notifies with the…
.focused – Returns the (virtual) focused LI element.
.getColumn – Returns the content of the column for the item by its index…
.getIcon – Returns the item ICON (or NULL if does not exist)…
.getId – Returns the item ID (or NULL if does not exists)…
.getIndex – Returns the index starting from 0 for the item (or NULL if does not exists)…
.getLabel – Returns the text value of item (or NULL if does not exists)…
.getWidth – Returns the column width (in pixels).
.hasCheckbox – Returns TRUE if the item has a checkbox.
.hasChildren – Returns TRUE if the item has childrens.
.hasFocus – Returns TRUE if the treeview control has the focus.
.hasIcon – Returns TRUE if item has ICON.
.hasNext – Returns TRUE if there is at least a element after item (belonging to the same…
.hasParent – Returns TRUE if item has a parent.
.hasPrev – Returns TRUE if there is at least a element before item (belonging to the same…
.hasRadio – Returns TRUE if the item has a radio.
.hasSiblings – Returns TRUE if item has siblings on the same level (belonging to the same…
.hidden – Filter items and return only the hidden items…
.hide – Hide the item node and all his childrens…
.init – Init the treeview control (if not initialized already), .isLocked will return…
.inodes – Filter items and return only the `inode` items…
.isBusy – Returns TRUE if the item node is loading.
.isChecked – Returns TRUE if the item is checked.
.isChildren – Returns TRUE if children have parent as parent…
.isClosed – Returns TRUE if the item node is closed.
.isColumn – Returns TRUE if the column is visible.
.isDisabled – Returns TRUE if the item is disabled.
.isDisabledPath – Returns TRUE if any of the item parents are disabled…
.isEdited – Returns TRUE if the item is edited right now…
.isEnabled – Returns TRUE if the item is enabled.
.isEnabledPath – Returns TRUE if all of the item parents are enabled…
.isFirst – Returns TRUE if item is the first item for its parent…
.isFocused – Returns TRUE if the item has (virtual) focus…
.isHidden – Returns TRUE if the item node is hidden.
.isHiddenPath – Returns TRUE if the path to item is hidden (a parent node is hidden)…
.isImmediateChildren – Returns TRUE if children have parent as direct parent…
.isInode – Returns TRUE if item is a inner node (has childrens)…
.isItem – Returns TRUE if item is a valid item.
.isLast – Returns TRUE if item is the last item for its parent…
.isLeaf – Returns TRUE if item is a leaf node (does not have any childrens)…
.isLocked – Returns TRUE if the treeview control is in the init or destroy operation…
.isOpen – Returns TRUE if the item node is opened.
.isOpenPath – Returns TRUE if the path to item is open (all the parent nodes are open)…
.isPersist – Returns TRUE if there is any saved data.
.isSelected – Returns TRUE if the item is selected.
.isTristate – Returns TRUE if the item is tristate.
.isVisible – Returns TRUE if item is visible (if all parent nodes are opened and the item…
.itemData – Returns the related item (updated) properties as defined in the JSON…
.itemFrom – Returns the LI that contains the element.
.last – Returns the last children of item.
.leaves – Filter items and return only the leaf items…
.level – Returns the item level starting from 0 for the ones in ROOT (or -1 if does not…
.loadFrom – Loads a node from a JavaScript variable (if not already loaded)…
.moveAfter – Move item after a specific item…
.moveBefore – Move item before a specific item…
.moveDown – Move item down with a position (inside the same parent)…
.moveFirst – Move item at the beginning (inside the same parent)…
.moveLast – Move item at the end (inside the same parent)…
.moveUp – Move item up with a position (inside the same parent)…
.next – Returns the next element from item (belonging to the same parent)…
.nextMatch – Search for a match starting with the item after item…
.open – Opens the item node and all his childrens (if requested)…
.openPath – Opens the entire path till item…
.option – Set a option at runtime (after init).
.options – Returns the init options (including any new value assigned with option)…
.parent – Returns the parent of item.
.path – Returns a list of parent items till item (starting from ROOT)…
.pathId – Returns a list of parent IDs till item (starting from ROOT)…
.prev – Returns the previous element from item (belonging to the same parent)…
.prevMatch – Search for a match starting with the item before item…
.radios – Filter items and return only the items with a radio-button…
.remove – Remove item (including the childrens)…
.removeCheckbox – Remove a checkbox element from the item…
.removeIcon – Remove the ICON image for item…
.removeRadio – Remove a radio-button element from the item…
.sameParent – Returns TRUE if item1 and item2 have the same direct parent…
.sameTopParent – Returns TRUE if item1 and item2 have the same parent on level 0…
.search – Searches the elements with an ID or a custom property…
.searchId – Searches and returns the LI element with a ID…
.searchPath – Searches a LI element based on a list of IDs…
.select – Selects the item.
Notifies with the…
.selected – Returns the selected LI element(s).
.serialize – Returns a serialized value depending on the what option…
.setColumn – Set the item column content.
Notifies…
.setId – Set the item ID.
Notifies with the…
.setIndex – Set the item index.
Notifies with the…
.setInode – Transforms item in a inner node…
.setLabel – Set the item text content.
Notifies…
.setLeaf – Transforms item in a leaf node…
.setVisible – Brings item into the view…
.setWidth – Set the column width (in pixels).
Notifies with the…
.siblings – Returns a list of item siblings (belonging to the same parent)…
.swap – Exchanges two items (the items can’t be children and parent)…
.toggle – Opens or closes the item node…
.toggleColumn – Show or hide a column.
.topParent – Returns the parent on the level 0 for item…
.tristate – Filter items and return only the tristate items…
.uncheck – Set a checkbox or radio-button in the unchecked state…
.unload – Removes all the item childrens…
.unpersist – Removes the save data (if there is any).
.visible – Filter items and return only the visible items (the items with all parent…
.wasInit – Returns TRUE if the treeview control was initialized.
.wasLoad – Returns TRUE if item was loaded.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the checkboxadded event if the checkbox was added, with wascheckbox if the item was already of the checkbox
type and with addcheckboxfail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeaddcheckbox.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- icon: (string) CSS class name or Array(CSS class, background-position-x, background-position-y)
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIcon – the old ICON (or NULL if had not existed).
Notifies with the iconadded event when adding/updating the icon, wasicon if the ICON was set already
and with addiconfail when the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeaddicon.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the radioadded event if the radio-button was added, with wasradio event if the item was already of the radio-button
type and with addradiofail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeaddradio.
where:
item jQuery object the LI after which the new elements are added
options
- object {
- success: function (item, options),
- fail: function (item, options),
- itemData:
- (object) { itemData } or
- (array) [ (object) { itemData }, … ]
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.items – a list of LI elements (the new added ones).
options.itemData can be an array of objects to add many items at once. .after adds only one level, if you want to add childrens to the new nodes –
you can use .loadFrom (or they will be loaded by default when the nodes will be opened, using .ajaxLoad).
.after calls options.itemHook init option for each item and notifies regarding the add (after changing the DOM) with the added event.
Notifies with the appended and appendfail events if the operation was successful or not. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforeafter.
where:
item jQuery object the LI node to be loaded (or NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
The loading with AJAX take place when the nodes are opened for the first time. .ajaxLoad can be called to force
loading a node. The node need to be of type inode and not already loaded. If the node was loaded and you want to reload it –
you’ll need to call .unload before calling .ajaxLoad.
The JSON data is requested from the address configured in the init options options.ajax.url and adding the ID of the node to be loaded at the end.
Are added as many levels as defined in the JSON. Each item’s data is stored and can be accessed with .itemData.
Note: if the operation fails then the node will be made of type leaf by default.
.ajaxLoad calls .append for adding the items.
Notifies with the loaded and loadfail events if the operation was successful or not and with the wasloaded
if the node was loaded already. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforeload.
See .loadFrom for loading from a JavaScript variable (instead of AJAX).
where:
item jQuery object the LI to add the childrens to (or NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- itemData:
- (object) { itemData } or
- (array) [ (object) { itemData }, … ]
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.items – a list of LI elements (the new added ones).
options.itemData can be an array of objects to add many items at once. .append adds only one level, if you want to add childrens to the new nodes –
you can use .loadFrom (or they will be loaded by default when the nodes will be opened, using .ajaxLoad).
.append calls options.itemHook init option for each item and notifies regarding the add (after the DOM is changed) with the added event.
Notifies with the appended and appendfail events if the operation was successful or not. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforeappend.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options),
- parent: (jQuery object) the parent item
- }
where:
item the LI
options the initial options parameter
asChild set the item as a children only for empty parents (elements without childrens). If the parent item is of type leaf then .setInode is called.
Notifies with the childset and childfail events if the operation was successful or not. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforechild.
where:
item jQuery object the LI before which the new elements are added
options
- object {
- success: function (item, options),
- fail: function (item, options),
- itemData:
- (object) { itemData } or
- (array) [ (object) { itemData }, … ]
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.items – a list of LI elements (the new added ones).
options.itemData can be an array of objects to add many items at once. .before adds only one level, if you want to add childrens to the new nodes –
you can use .loadFrom (or they will be loaded by default when the nodes will be opened, using .ajaxLoad).
.before calls options.itemHook init option for each item and notifies regarding the add (after the DOM is changed) with the added event.
Notifies with the before and beforefail events if the operation was successful or not. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforebefore.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the blur and blurfail events if the operation succeeded or not and with
the notfocused event if the item did not had focus.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeblur.
where:
item jQuery object the parent LI (or NULL for ROOT)
callback function (item)
where:
item the LI
load (boolean) if TRUE then all – not yet loaded – nodes will be loaded and the
callback will be run for their childrens too
Inside the callback function you can access the aciTree API with this keyword.
.branch calls .ajaxLoad when it needs to load a node.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the checked and checkfail events if the operation succeeded or not and with the
waschecked event if the item was already checked. The operation can be canceled by
returning FALSE from the event handler when eventName is equal with beforecheck.
where:
items jQuery object a list of LI elements
state (boolean) if set, returns only the elements in the checked/unchecked state (TRUE/FALSE)
where:
item jQuery object the parent LI (or NULL for ROOT)
branch (boolean) if TRUE then all item childrens are returned (not only
the direct ones)
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI to be closed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- collapse: (boolean) if TRUE then all childrens will be closed too,
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
If the initialization option options.empty is TRUE then all childrens are removed (.unload will be called).
Notifies with the closed and closefail events if the operation was successful or not and with wasclosed if was closed already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeclose.
where:
item jQuery object the LI to remain open
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.closeOthers calls .close to close all needed nodes.
where:
props (string) the props value used in options.columnData
where:
item jQuery object the LI to be deselected
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the deselected and deselectfail events if the operation succeeded or not and with
the notselected event if the item was not selected.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforedeselect.
where:
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
.destroy calls .unload for ROOT and notifies with the notinit event if the treeview control was not initialized yet.
Notifies with the destroyed and destroyfail events if the operation was successful or not.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforedestroy.
where:
item jQuery object the LI to be disabled
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the disabled and disablefail events if the operation was successful or not and with wasdisabled if the node
was already disabled.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforedisable.
where:
items jQuery object a list of LI elements
where:
item jQuery object the LI to be edited
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the edit when it enters the edit mode, with wasedit if was in the edit mode already and
with editfail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeedit.
where:
item jQuery object the LI to be enabled
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the enabled and enablefail events if the operation was successful or not and with wasenabled if the node
was already enabled.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeenable.
where:
items jQuery object a list of LI elements
where:
options
- object {
- success: function (item, options),
- fail: function (item, options),
- save: (boolean) if FALSE then any changes made will not be saved
- }
where:
item the LI
options the initial options parameter
.endEdit calls .setLabel to save the changes.
Notifies with the edited when changes are saved, endedit when it exits from the edit mode without saving the changes
and with endeditfail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeendedit.
where:
item jQuery object the parent LI to start from (NULL to start from ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- search: (string) the searched value
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.first – the first found item (if any).
Note: the returned first found item it’s not in the tree branch order, use .prevMatch and/or .nextMatch
to search and get items in branch order.
.filter calls options.filterHook init option for each item and
notifies with the filtered and filterfail events if the operation was successful or not.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforefilter.
where:
item jQuery object the parent LI (or NULL for ROOT)
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI to be focused
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldFocused – the previous item with focus.
Notifies with the focus and focusfail events if the operation succeeded or not and with the
wasfocused if the item already had focus.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforefocus.
where:
item jQuery object the LI
index (numeric) the column index (0 based)
where:
item jQuery object the LI
Can return a string or array (depending on the init value).
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
index (numeric) the column index (0 based)
where:
item jQuery object the LI
where:
item jQuery object the LI (or NULL for ROOT)
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
items jQuery object a list of LI elements
where:
item jQuery object the LI to be hidden
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the hidden and hidefail events if the operation was successful or not and with washidden if the node
was already hidden.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforehide.
where:
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
.init calls .loadFrom or .ajaxLoad depending on the init options and notifies with the wasinit event
if was initialized already.
Notifies with the init and initfail events if the operation was successful or not.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeinit.
where:
items jQuery object a list of LI elements
state (boolean) if set, returns only the nodes in the open/closed state (TRUE/FALSE)
where:
item jQuery object the LI (or NULL for ROOT)
where:
item jQuery object the LI
where:
parent jQuery object the parent LI
children jQuery object the children LI
where:
index (numeric) the column index (0 based)
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
parent jQuery object the parent LI
children jQuery object the children LI
where:
item jQuery object the LI
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
where:
item jQuery object the LI
Note that not all node properties are updated in real time after you use the API and the branch property does not contain the
children. If you want to read the updated properties – including the children list – you can use the .serialize method.
where:
element jQuery object a children element for LI
where:
item jQuery object the parent LI (or NULL for ROOT)
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
items jQuery object a list of LI elements
where:
item jQuery object the LI
where:
item jQuery object the LI to be loaded (or NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used,
- itemData:
- (array) [ (object) { itemData }, … ]
- }
where:
item the LI
options the initial options parameter
.loadFrom can be called to load a node from a JavaScript variable.
The node need to be of type inode and not already loaded. If the node was loaded and you want to reload it –
you’ll need to call .unload before calling .loadFrom. Are added as many levels as defined in the JavaScript variable.
Each item’s data is stored and can be accessed with .itemData.
Note: if the operation fails then the node will be made of type leaf by default.
.loadFrom calls .append to add the items.
Notifies with the loaded and loadfail events if the operation was successful or not and with the wasloaded
if the node was loaded already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeload.
See .ajaxLoad for loading with AJAX.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options),
- after: (jQuery object) the element after which to move item
- }
where:
item the LI
options the initial options parameter
Notifies with the moved and movefail events if the operation was successful or not and with the wasafter
if the item was in the requested position.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforemove.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options),
- before: (jQuery object) the element before which to move item
- }
where:
item the LI
options the initial options parameter
Notifies with the moved and movefail events if the operation was successful or not and with the wasbefore
if the item was in the requested position.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforemove.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIndex – the item old index (starting with 0).
.moveDown calls .setIndex to change item position.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIndex – the item old index (starting with 0).
.moveFirst calls .setIndex to change item position.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIndex – the item old index (starting with 0).
.moveLast calls .setIndex to change item position.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIndex – the item old index (starting with 0).
.moveUp calls .setIndex to change item position.
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI (or NULL to start with the first item)
search (string) the value to search for
callback function (item)
where:
item the found LI (if any)
Inside the callback function you can access the aciTree API with this keyword.
.nextMatch calls options.filterHook init option for each item.
where:
item jQuery object the LI to be opened
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unique: (boolean) if TRUE then all other nodes are closed,
- expand: (boolean) if TRUE then the childrens are opened too,
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.open calls .ajaxLoad when it needs to load a node.
Notifies with the opened and openfail events if the operation was successful or not and with wasopened if the node
was already opened.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeopen.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.openPath calls .open to open the nodes.
where:
option (string) the option to change
value (mixed) the new value (in the same format like the init options)
where:
item jQuery object the LI
reverse (boolean) if TRUE the list will be reversed
where:
item jQuery object the LI
reverse (boolean) if TRUE the list will be reversed
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
item jQuery object the LI (or NULL to start with the last item)
search (string) the value to search for
callback function (item)
where:
item the found LI (if any)
Inside the callback function you can access the aciTree API with this keyword.
.prevMatch calls options.filterHook init option for each item.
where:
items jQuery object a list of LI elements
state (boolean) if set, returns only the elements in the checked/unchecked state (TRUE/FALSE)
where:
item jQuery object the LI to be removed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.remove calls .unload to remove the childrens and .setLeaf to set the parent node if there was a single child node.
Notifies with the removed and removefail events if the operation was successful or not.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeremove.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the checkboxremoved event if the checkbox was removed, with notcheckbox if the item was not of the checkbox
type and with removecheckboxfail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeremovecheckbox.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIcon – the old ICON (or NULL if had not existed).
Notifies with the iconremoved event if the ICON was removed, noticon if the ICON did not exist
and with removeiconfail when the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeremoveicon.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the radioremoved event if the radio-button was removed, with notradio if the item was not of the radio-button
type and with removeradiofail if the operation failed.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeremoveradio.
where:
item1 jQuery object the LI
item2 jQuery object the LI
where:
item1 jQuery object the LI
item2 jQuery object the LI
where:
item jQuery object the LI to start with (NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- search: (string) the ID to search for,
- load: (boolean) if TRUE then the nodes will be loaded if required,
- callback: function (item, search) used to do a custom search
- }
where:
item the first found element
options the initial options parameter
The options object sent to success function will contain the following new properties:
options.results – the found nodes.
.search calls .ajaxLoad when it needs to load a node.
where:
path (boolean) if TRUE then the search stops to the first branch with the ID inside the searched ID
(the IDs need to be path like, the ID of a children need to start with the ID of the parent and add something else after it)
load (boolean) if TRUE then all not yet loaded nodes will be loaded and
the search will be made for the childrens too (only if path is TRUE)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- id: (string) the ID to search for
- }
where:
item found element
options the initial options parameter
.searchId calls .ajaxLoad when it needs to load a node.
where:
item jQuery object the LI to start with (NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- path: (array) the ID list to search for,
- load: (boolean) if TRUE then the nodes will be loaded if required
- }
where:
item found element
options the initial options parameter
.searchPath calls .ajaxLoad when it needs to load a node.
where:
item jQuery object the LI to be selected
options
- object {
- success: function (item, options),
- fail: function (item, options),
- focus: (boolean) if FALSE then the focus will not be set
- }
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldSelected – the previous selected item(s).
Notifies with the selected and selectfail events if the operation succeeded or not and with the
wasselected if the item was already selected.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeselect.
where:
item jQuery object the LI to start with (or NULL to start from the ROOT)
what (string) type of the wanted value to be serialized
callback function (item, what, value)
where:
item the LI who need to be serialized
what the value type to be serialized what
value the value who will be serialized (depending on what)
The 4.2 version let you use the following values for what: `checkbox`, `radio` (to serialize the selected
checkboxes or radio-buttons, options implemented by the extensions with the same name) and an empty object
(to serialize the entire tree structure, including the added custom properties).
Inside the callback function you can access the aciTree API with this keyword.
If callback is not set then the options.serialize init option will be used by default.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- index: (numeric) the column index (0 based),
- value: (string) the new content
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldValue – the old content.
Notifies with the columnset and columnfail
events if the operation was successful or not and with the wascolumn event if the content was of the same value already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforecolumn.
.setColumn will set a property named options.columnData[].props, you must take care not to use any property name
defined by default in the itemData object.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- id: (string) the new ID
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldId – the old ID.
Note: the ID need to be unique at the treeview control level.
Notifies with the idset and idfail
events if the operation was successful or not and with the wasid event if the ID was of the same value already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeid.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- index: (numeric) the new index
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldIndex – the old index.
Notifies with the indexset and indexfail
events if the operation was successful or not and with the wasindex event if the index was of the same value already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeindex.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the inodeset and inodefail
events if the operation was successful or not and with the wasinode event if was a inner node already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeinode.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- label: (string) the new label
- }
succeeded and fail if failed, you can access the aciTree API with this keyword.
where:
item the LI
options the initial options parameter
The options object sent to success and fail functions will contain the following new properties:
options.oldLabel – the old label.
Notifies with the labelset and labelfail
events if the operation was successful or not and with the waslabel event if the label was of the same value already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforelabel.
where:
item jQuery object the LI to be changed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.setLeaf calls .unload to remove all childrens and notifies with the leafset and leaffail
events if the operation was successful or not and with the wasleaf event if was a leaf node already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeleaf.
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used,
- center: (boolean) if TRUE the item will be centered in view
- }
where:
item the LI
options the initial options parameter
.setVisible calls .openPath to open all parent nodes.
Notifies with the visible and visiblefail
events if the operation was successful or not and with the wasvisible event if was in the visible zone already.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforevisible.
where:
index (numeric) the column index (0 based)
width (numeric) the new width
where:
item jQuery object the LI to be show
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the shown and showfail events if the operation was successful or not and with wasshown if the node
was already visible.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeshow.
where:
item jQuery object the LI
hidden (boolean) if TRUE then the hidden elements will be considered too
where:
options
- object {
- success: function (item, options),
- fail: function (item, options),
- item1: the first LI item,
- item2: the second LI item,
- }
where:
item the LI
options the initial options parameter
Notifies with the swapped and swapfail events the success or failure of the operation.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeswap.
where:
item jQuery object the LI to be opened/closed
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unique: (boolean) if TRUE then (on node opening) all other nodes will be closed,
- expand: (boolean) if TRUE then (on open) all childrens will be opened too,
- collapse: (boolean) if TRUE then (on close) all childrens will be closed too,
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.toggle calls .open or .close to open/close a node.
Notifies with the toggled and togglefail events if the operation was successful or not.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforetoggle.
where:
index (numeric) the column index (0 based)
show (boolean) (if set) state changes to this value
where:
items jQuery object a list of LI elements
where:
item jQuery object the LI
options
- object {
- success: function (item, options),
- fail: function (item, options)
- }
where:
item the LI
options the initial options parameter
Notifies with the unchecked and uncheckfail events if the operation was successful or not and with the
notchecked event if the element was not checked.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with beforeuncheck.
where:
item jQuery object the LI (or NULL for ROOT)
options
- object {
- success: function (item, options),
- fail: function (item, options),
- unanimated: (boolean) if TRUE then no animations will be used
- }
where:
item the LI
options the initial options parameter
.unload calls .close to close a opened node and notifies with the removed event about removing each of the childrens.
Notifies with the unloaded and unloadfail events if the operation was successful or not and with notloaded if the node was not loaded.
The operation can be canceled by returning FALSE from the event handler when eventName is equal with
beforeunload.
where:
items jQuery object a list of LI elements
view (boolean) if TRUE, returns only the items in view
.visible will call .isVisible to find if a item is in view.
where:
item jQuery object the LI (or NULL for ROOT)
aciTree jQuery Plugin v4.5.0-rc.3
http://acoderinsights.ro
Copyright (c) 2014 Dragos Ursu
Dual licensed under the MIT or GPL Version 2 licenses.
Require jQuery Library >= v1.9.0 http://jquery.com
+ aciPlugin >= v1.5.1 https://github.com/dragosu/jquery-aciPlugin