TreeCollection

View-less component that stores a collection of hierarchical data.

var store = new webix.TreeCollection({ url:"tree.php" });
Methods
add adds an item to the store
addBind adds one more bound target
attachEvent attaches the handler to an inner event of the component
bind binds components
blockEvent temporarily blocks triggering of ALL events of the calling object
callEvent calls an inner event
clearAll removes all items from the component
clearValidation removes all validation marks from the component
copy copies an item to the same or another object
count returns the number of currently visible items
define redefines a single configuration property (or a hash of properties)
destructor destructs the calling object
detachEvent detaches a handler from an event (which was attached before by the attachEvent method)
exists checks whether an item with the specified id exists
filter filters the component
find returns all rows that match the criterion, or only the first one
getBindData fills the target object with data
getBranchIndex gets index of the node in a specific branch
getCursor returns the current cursor position.
getFirstChildId gets the ID of the first child of the specified branch
getFirstId returns the ID of the first item
getIdByIndex returns the id of the item with the specified index
getIndexById returns the index of the item with the specified id
getItem gets the object of the data item with the specified id
getLastId returns the id of the last item
getNextId returns the ID of an item which is positioned the specified step after the specified item
getNextSiblingId returns the id of the next sibling of the specified node
getParentId get the ID of the parent node of the specified item
getPrevId returns the ID of an item which is positioned the specified step before the specified item
getPrevSiblingId returns the id of the previous sibling of the specified node
hasEvent checks whether the component has the specified event
isBranch checks whether the node has any children
isVisible returns true if current view is visible
load loads data from an external data source
loadBranch loads data to the specified branch, as direct children of the node with the ID provided
loadNext sends a request to load the specified number of records to the end of the client-side dataset or to the specified position
mapEvent routes events from one object to another
move moves the specified item to a new position
moveBottom moves the specified item to the last position
moveTop moves the specified item to the first position
parse loads data to the component from an inline data source
refresh repaints the whole view or a certain item
refreshCursor force repainting of all bound components with current cursor value
remove removes the specified item/items from datastore
removeBind disables data binding
saveBatch makes simultaneous saving of several components
serialize serializes data to an array of JSON objects
setBindData moves data from master to child
setCursor sets the position of the cursor
sort sorts datastore
sync allows syncing two copies of data (all or just a part of it) from one DataCollection to another
unbind breaks "bind" link
unblockEvent cancels events blocking that was enabled by the 'blockEvent' command
updateItem updates the data item with new properties
validate validates one record or all dataset against the validation rules
waitSave allows to catch the moment when a data operation was saved to the server
Events
onAfterAdd fires after adding an item to the datastore
onAfterCursorChange fires after the cursor changes its position.
onAfterDelete fires after an item is removed
onAfterLoad fires after data loading is complete
onAfterSort fires after sorting dataset
onBeforeAdd fires before adding an item to the datastore
onBeforeCursorChange fires before the cursor changes its position.
onBeforeDelete fires before an item is removed
onBeforeLoad fires immediately before data loading has started
onBeforeSort fires before sorting of the dataset
onBindRequest fires when the component is ready to receive data from the master component
onBindUpdate fires when data is changed in the child and 'save()' is called to update the master.
onDataRequest fires when data from the server is requested for linear data structures (List, DataTable, DataView etc.) to implement dynamic data loading
onDataUpdate fires when a data item is being updated
onDestruct occurs when component destroyed
onLoadError fires when an error occurs during data loading (invalid server side response)
onValidationError fires when newly loaded/added/edited data fail to pass validation
onValidationSuccess fires after the newlyloaded/added/edited data has passes validation successfully
Properties
data JavaScript array containing data for the component
datathrottle sets the polling interval (the time period between the completion of a network request and the next request for data)
datatype the type of loaded data
defaultData the property stores data which is displayed in the slave when no records are selected in the master
externalData allows defining custom 'move' logic for the component.
filterMode defines the pattern for tree item filtering
id the ID of a widget
map defines data mapping
on allows attaching custom handlers to inner events of the component
ready the event handler is called just after the component has been completely initialized
removeMissed defines how to treat items in case of reloading
rules set of validation rules for the component
save defines URLs for data saving
scheme defines schemes for data processing
url the URL which the component will use to load data after its initialization
Other
config all options from the initial component configuration
data inner DataStore
name indicates the name of the component (a read-only property)
waitData eventual result of an asynchronous operation ('promise' object) for the loaded data
Back to top